<!doctype html>
<head><meta charset="utf-8"><meta property="og:image" content="https://tc39.es/ecmarkup/ecma-logo.png"><meta property="og:title" content="Pattern Matching"><meta property="og:description" content="Welcome

  
    TODOs
    
      
        Scope and bindings
        
          Basic case.
          Work with `for` loop (CreatePerIterationEnvironment).
          Work with function parameters.
        
      
    
  

  
      Introduction
      This specification consists of the following pa">
<title>Pattern Matching</title><script src="assets/ecmarkup.js?cache=rh3pBrXc" defer=""></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/base16/solarized-light.min.css"><link rel="stylesheet" href="assets/ecmarkup.css"><link rel="stylesheet" href="assets/print.css" media="print"><style>
    @media print {
      @page :left {
        @bottom-right {
          content: '© Ecma International 2024';
        }
      }
      @page :right {
        @bottom-left {
          content: '© Ecma International 2024';
        }
      }
      @page :first {
        @bottom-left {
          content: '';
        }
        @bottom-right {
          content: '';
        }
      }
      @page :blank {
        @bottom-left {
          content: '';
        }
        @bottom-right {
          content: '';
        }
      }
    }
    </style></head><body><div id="shortcuts-help">
<ul>
  <li><span>Toggle shortcuts help</span><code>?</code></li>
  <li><span>Toggle "can call user code" annotations</span><code>u</code></li>

  <li><span>Jump to search box</span><code>/</code></li>
  <li><span>Toggle pinning of the current clause</span><code>p</code></li>
  <li><span>Jump to <i>n</i>th pin</span><code>1-9</code></li>
</ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120" width="54" height="54">
      <title>Menu</title>
      <path stroke-width="10" stroke-linecap="round" d="M30,60 h60  M30,30 m0,5 h60  M30,90 m0,-5 h60"></path>
    </svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins<button class="unpin-all">clear</button></div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">+</span><a href="#welcome" title="Welcome">Welcome</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-todos" title="TODOs">TODOs</a></li><li><span class="item-toggle-none"></span><a href="#sec-nav" title="Introduction">Introduction</a></li><li><span class="item-toggle-none"></span><a href="#sec-notes-layering" title="Layering">Layering</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-overview" title="Overview"><span class="secnum">4</span> Overview</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-organization-of-this-specification" title="Organization of This Specification"><span class="secnum">4.5</span> Organization of This Specification</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-ecmascript-data-types-and-values" title="ECMAScript Data Types and Values"><span class="secnum">6</span> ECMAScript Data Types and Values</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-types" title="ECMAScript Language Types"><span class="secnum">6.1</span> ECMAScript Language Types</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-types-symbol-type" title="The Symbol Type"><span class="secnum">6.1.5</span> The Symbol Type</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-well-known-symbols" title="Well-Known Symbols"><span class="secnum">6.1.5.1</span> Well-Known Symbols</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-object-internal-methods-and-internal-slots" title="Object Internal Methods and Internal Slots"><span class="secnum">6.1.7</span> Object Internal Methods and Internal Slots</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-abstract-operations" title="Abstract Operations"><span class="secnum">7</span> Abstract Operations</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-operations-on-objects" title="Operations on Objects"><span class="secnum">7.3</span> Operations on Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-initializeinstance" title="InitializeInstanceElements ( O, constructor )"><span class="secnum">7.3.34</span> InitializeInstanceElements ( <var>O</var>, <var>constructor</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-syntax-directed-operations" title="Syntax-Directed Operations"><span class="secnum">8</span> Syntax-Directed Operations</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-syntax-directed-operations-scope-analysis" title="Scope Analysis"><span class="secnum">8.2</span> Scope Analysis</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-boundnames" title="Static Semantics: BoundNames"><span class="secnum">8.2.1</span> SS: BoundNames</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-declarationpart" title="Static Semantics: DeclarationPart"><span class="secnum">8.2.2</span> SS: DeclarationPart</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-isconstantdeclaration" title="Static Semantics: IsConstantDeclaration"><span class="secnum">8.2.3</span> SS: IsConstantDeclaration</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-lexicallydeclarednames" title="Static Semantics: LexicallyDeclaredNames"><span class="secnum">8.2.4</span> SS: LexicallyDeclaredNames</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-lexicallyscopeddeclarations" title="Static Semantics: LexicallyScopedDeclarations"><span class="secnum">8.2.5</span> SS: LexicallyScopedDeclarations</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-vardeclarednames" title="Static Semantics: VarDeclaredNames"><span class="secnum">8.2.6</span> SS: VarDeclaredNames</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-varscopeddeclarations" title="Static Semantics: VarScopedDeclarations"><span class="secnum">8.2.7</span> SS: VarScopedDeclarations</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-toplevellexicallydeclarednames" title="Static Semantics: TopLevelLexicallyDeclaredNames"><span class="secnum">8.2.8</span> SS: TopLevelLexicallyDeclaredNames</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-toplevellexicallyscopeddeclarations" title="Static Semantics: TopLevelLexicallyScopedDeclarations"><span class="secnum">8.2.9</span> SS: TopLevelLexicallyScopedDeclarations</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-toplevelvardeclarednames" title="Static Semantics: TopLevelVarDeclaredNames"><span class="secnum">8.2.10</span> SS: TopLevelVarDeclaredNames</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-toplevelvarscopeddeclarations" title="Static Semantics: TopLevelVarScopedDeclarations"><span class="secnum">8.2.11</span> SS: TopLevelVarScopedDeclarations</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-syntax-directed-operations-miscellaneous" title="Miscellaneous"><span class="secnum">8.6</span> Miscellaneous</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-runtime-semantics-bindinginitialization" title="Runtime Semantics: BindingInitialization"><span class="secnum">8.6.2</span> RS: BindingInitialization</a></li><li><span class="item-toggle-none"></span><a href="#sec-runtime-semantics-iteratorbindinginitialization" title="Runtime Semantics: IteratorBindingInitialization"><span class="secnum">8.6.3</span> RS: IteratorBindingInitialization</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-executable-code-and-execution-contexts" title="Executable Code and Execution Contexts"><span class="secnum">9</span> Executable Code and Execution Contexts</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-weakly-hold-targets-processing-model" title="Processing Model of WeakRef and FinalizationRegistryweakly hold Targets"><span class="secnum">9.10</span> Processing Model of <del>WeakRef and FinalizationRegistry</del><ins>weakly hold</ins> Targets</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-weakly-hold-execution" title="Execution"><span class="secnum">9.10.3</span> Execution</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-lexical-grammar" title="ECMAScript Language: Lexical Grammar"><span class="secnum">12</span> ECMAScript Language: Lexical Grammar</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-automatic-semicolon-insertion" title="Automatic Semicolon Insertion"><span class="secnum">12.10</span> Automatic Semicolon Insertion</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-rules-of-automatic-semicolon-insertion" title="Rules of Automatic Semicolon Insertion"><span class="secnum">12.10.1</span> Rules of Automatic Semicolon Insertion</a></li><li><span class="item-toggle">+</span><a href="#sec-interesting-cases-of-automatic-semicolon-insertion" title="Interesting Cases of Automatic Semicolon Insertion"><span class="secnum">12.10.3</span> Interesting Cases of Automatic Semicolon Insertion</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-asi-cases-with-no-lineterminator-here" title="Cases of Automatic Semicolon Insertion and “[no LineTerminator here]”"><span class="secnum">12.10.3.2</span> Cases of Automatic Semicolon Insertion and “[no <emu-nt>LineTerminator</emu-nt> here]”</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-no-lineterminator-here-automatic-semicolon-insertion-list" title="List of Grammar Productions with Optional Operands and “[no LineTerminator here]”"><span class="secnum">12.10.3.2.1</span> List of Grammar Productions with Optional Operands and “[no <emu-nt>LineTerminator</emu-nt> here]”</a></li></ol></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-expressions" title="ECMAScript Language: Expressions"><span class="secnum">13</span> ECMAScript Language: Expressions</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-primary-expression" title="Primary Expression"><span class="secnum">13.2</span> Primary Expression</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-primary-expression-match-expression" title="Match Expression"><span class="secnum">13.2.10</span> Match Expression</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-relational-operators" title="Relational Operators"><span class="secnum">13.10</span> Relational Operators</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-relational-operators-runtime-semantics-evaluation" title="Runtime Semantics: Evaluation"><span class="secnum">13.10.1</span> RS: Evaluation</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-statements-and-declarations" title="ECMAScript Language: Statements and Declarations"><span class="secnum">14</span> ECMAScript Language: Statements and Declarations</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-iteration-statements" title="Iteration Statements"><span class="secnum">14.7</span> Iteration Statements</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-for-in-and-for-of-statements" title="The for-in, for-of, and for-await-of Statements"><span class="secnum">14.7.1</span> The <code>for</code>-<code>in</code>, <code>for</code>-<code>of</code>, and <code>for</code>-<code>await</code>-<code>of</code> Statements</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-try-statement" title="The try Statement"><span class="secnum">14.14</span> The <code>try</code> Statement</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-ecmascript-language-functions-and-classes" title="ECMAScript Language: Functions and Classes"><span class="secnum">15</span> ECMAScript Language: Functions and Classes</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-class-definitions" title="Class Definitions"><span class="secnum">15.7</span> Class Definitions</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-runtime-semantics-classdefinitionevaluation" title="Runtime Semantics: ClassDefinitionEvaluation"><span class="secnum">15.7.14</span> RS: ClassDefinitionEvaluation</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-tail-position-calls" title="Tail Position Calls"><span class="secnum">15.10</span> Tail Position Calls</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-hascallintailposition" title="Static Semantics: HasCallInTailPosition"><span class="secnum">15.10.2</span> SS: HasCallInTailPosition</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-fundamental-objects" title="Fundamental Objects"><span class="secnum">20</span> Fundamental Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-object-objects" title="Object Objects"><span class="secnum">20.1</span> Object Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-object-constructor" title="Properties of the Object Constructor"><span class="secnum">20.1.2</span> Properties of the Object Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-object-%symbol.custommatcher%" title="Object [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.1.2.24</span> Object [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-function-objects" title="Function Objects"><span class="secnum">20.2</span> Function Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-function-constructor" title="Properties of the Function Constructor"><span class="secnum">20.2.2</span> Properties of the Function Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-function-%symbol.custommatcher%" title="Function [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.2.2.2</span> Function [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-function-prototype-object" title="Properties of the Function Prototype Object"><span class="secnum">20.2.3</span> Properties of the Function Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-function.prototype-%symbol.custommatcher%" title="Function.prototype [ %Symbol.customMatcher% ] ( subject, hint, receiver )"><span class="secnum">20.2.3.7</span> Function.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var>, <var>receiver</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-boolean-objects" title="Boolean Objects"><span class="secnum">20.3</span> Boolean Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-boolean-constructor" title="Properties of the Boolean Constructor"><span class="secnum">20.3.2</span> Properties of the Boolean Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-boolean-%symbol.custommatcher%" title="Boolean [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.3.2.2</span> Boolean [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-symbol-objects" title="Symbol Objects"><span class="secnum">20.4</span> Symbol Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-symbol-constructor" title="Properties of the Symbol Constructor"><span class="secnum">20.4.2</span> Properties of the Symbol Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-symbol.custommatcher" title="Symbol.customMatcher"><span class="secnum">20.4.2.17</span> Symbol.customMatcher</a></li><li><span class="item-toggle-none"></span><a href="#sec-symbol-%symbol.custommatcher%" title="Symbol [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.4.2.18</span> Symbol [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-error-objects" title="Error Objects"><span class="secnum">20.5</span> Error Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-error-constructor" title="The Error Constructor"><span class="secnum">20.5.1</span> The Error Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-error-message" title="Error ( message [ , options ] )"><span class="secnum">20.5.1.1</span> Error ( <var>message</var> [ , <var>options</var> ] )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-error-constructors" title="Properties of the Error Constructor"><span class="secnum">20.5.2</span> Properties of the Error Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-error-%symbol.custommatcher%" title="Error [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.5.2.2</span> Error [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-error-instances" title="Properties of Error Instances"><span class="secnum">20.5.4</span> Properties of Error Instances</a></li><li><span class="item-toggle">+</span><a href="#sec-nativeerror-object-structure" title="NativeError Object Structure"><span class="secnum">20.5.6</span> <var>NativeError</var> Object Structure</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-nativeerror-constructors" title="The NativeError Constructors"><span class="secnum">20.5.6.1</span> The <var>NativeError</var> Constructors</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-nativeerror" title="NativeError ( message [ , options ] )"><span class="secnum">20.5.6.1.1</span> <var>NativeError</var> ( <var>message</var> [ , <var>options</var> ] )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-nativeerror-constructors" title="Properties of the NativeError Constructors"><span class="secnum">20.5.6.2</span> Properties of the <var>NativeError</var> Constructors</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-nativeerror-%symbol.custommatcher%" title="NativeError [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.5.6.2.2</span> <var>NativeError</var> [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-nativeerror-instances" title="Properties of NativeError Instances"><span class="secnum">20.5.6.4</span> Properties of <var>NativeError</var> Instances</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-aggregate-error-objects" title="AggregateError Objects"><span class="secnum">20.5.7</span> AggregateError Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-aggregate-error-constructor" title="The AggregateError Constructor"><span class="secnum">20.5.7.1</span> The AggregateError Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-aggregate-error" title="AggregateError ( errors, message [ , options ] )"><span class="secnum">20.5.7.1.1</span> AggregateError ( <var>errors</var>, <var>message</var> [ , <var>options</var> ] )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-aggregate-error-constructors" title="Properties of the AggregateError Constructor"><span class="secnum">20.5.7.2</span> Properties of the AggregateError Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-aggregate-error-%symbol.custommatcher%" title="AggregateError [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">20.5.7.2.2</span> AggregateError [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-aggregate-error-instances" title="Properties of AggregateError Instances"><span class="secnum">20.5.7.4</span> Properties of AggregateError Instances</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-numbers-and-dates" title="Numbers and Dates"><span class="secnum">21</span> Numbers and Dates</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-number-objects" title="Number Objects"><span class="secnum">21.1</span> Number Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-number-constructor" title="Properties of the Number Constructor"><span class="secnum">21.1.2</span> Properties of the Number Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-number-%symbol.custommatcher%" title="Number [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">21.1.2.16</span> Number [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-bigint-objects" title="BigInt Objects"><span class="secnum">21.2</span> BigInt Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-bigint-constructor" title="Properties of the BigInt Constructor"><span class="secnum">21.2.2</span> Properties of the BigInt Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-bigint-%symbol.custommatcher%" title="BigInt [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">21.2.2.4</span> BigInt [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-date-objects" title="Date Objects"><span class="secnum">21.4</span> Date Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-date-constructor" title="Properties of the Date Constructor"><span class="secnum">21.4.3</span> Properties of the Date Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-date-%symbol.custommatcher%" title="Date [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">21.4.3.5</span> Date [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-text-processing" title="Text Processing"><span class="secnum">22</span> Text Processing</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-string-objects" title="String Objects"><span class="secnum">22.1</span> String Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-string-constructor" title="Properties of the String Constructor"><span class="secnum">22.1.2</span> Properties of the String Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-string-%symbol.custommatcher%" title="String [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">22.1.2.5</span> String [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-regexp-regular-expression-objects" title="RegExp (Regular Expression) Objects"><span class="secnum">22.2</span> RegExp (Regular Expression) Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-regexp-constructor" title="Properties of the RegExp Constructor"><span class="secnum">22.2.5</span> Properties of the RegExp Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-regexp-%symbol.custommatcher%" title="RegExp [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">22.2.5.3</span> RegExp [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-regexp-prototype-object" title="Properties of the RegExp Prototype Object"><span class="secnum">22.2.6</span> Properties of the RegExp Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-regexp.prototype-%symbol.custommatcher%" title="RegExp.prototype [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">22.2.6.20</span> RegExp.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-indexed-collections" title="Indexed Collections"><span class="secnum">23</span> Indexed Collections</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-array-objects" title="Array Objects"><span class="secnum">23.1</span> Array Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-array-constructor" title="Properties of the Array Constructor"><span class="secnum">23.1.2</span> Properties of the Array Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-array-%symbol.custommatcher%" title="Array [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">23.1.2.6</span> Array [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-typedarray-objects" title="TypedArray Objects"><span class="secnum">23.2</span> TypedArray Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-typedarray-constructors" title="Properties of the TypedArray Constructors"><span class="secnum">23.2.6</span> Properties of the <var>TypedArray</var> Constructors</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-_typedarray_-%symbol.custommatcher%" title="TypedArray [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">23.2.6.3</span> <var>TypedArray</var> [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-keyed-collections" title="Keyed Collections"><span class="secnum">24</span> Keyed Collections</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-map-objects" title="Map Objects"><span class="secnum">24.1</span> Map Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-map-constructor" title="Properties of the Map Constructor"><span class="secnum">24.1.2</span> Properties of the Map Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-map-%symbol.custommatcher%" title="Map [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">24.1.2.3</span> Map [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-set-objects" title="Set Objects"><span class="secnum">24.2</span> Set Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-set-constructor" title="Properties of the Set Constructor"><span class="secnum">24.2.2</span> Properties of the Set Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-set-%symbol.custommatcher%" title="Set [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">24.2.2.3</span> Set [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-weakmap-objects" title="WeakMap Objects"><span class="secnum">24.3</span> WeakMap Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-weakmap-constructor" title="Properties of the WeakMap Constructor"><span class="secnum">24.3.2</span> Properties of the WeakMap Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-weakmap-%symbol.custommatcher%" title="WeakMap [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">24.3.2.2</span> WeakMap [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-weakset-objects" title="WeakSet Objects"><span class="secnum">24.4</span> WeakSet Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-weakset-constructor" title="Properties of the WeakSet Constructor"><span class="secnum">24.4.2</span> Properties of the WeakSet Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-weakset-%symbol.custommatcher%" title="WeakSet [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">24.4.2.2</span> WeakSet [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-structured-data" title="Structured Data"><span class="secnum">25</span> Structured Data</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-arraybuffer-objects" title="ArrayBuffer Objects"><span class="secnum">25.1</span> ArrayBuffer Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-arraybuffer-constructor" title="Properties of the ArrayBuffer Constructor"><span class="secnum">25.1.5</span> Properties of the ArrayBuffer Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-arraybuffer-%symbol.custommatcher%" title="ArrayBuffer [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">25.1.5.4</span> ArrayBuffer [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-sharedarraybuffer-objects" title="SharedArrayBuffer Objects"><span class="secnum">25.2</span> SharedArrayBuffer Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-sharedarraybuffer-constructor" title="Properties of the SharedArrayBuffer Constructor"><span class="secnum">25.2.4</span> Properties of the SharedArrayBuffer Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-sharedarraybuffer-%symbol.custommatcher%" title="SharedArrayBuffer [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">25.2.4.3</span> SharedArrayBuffer [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-dataview-objects" title="DataView Objects"><span class="secnum">25.3</span> DataView Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-dataview-constructor" title="Properties of the DataView Constructor"><span class="secnum">25.3.3</span> Properties of the DataView Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-dataview-%symbol.custommatcher%" title="DataView [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">25.3.3.2</span> DataView [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-managing-memory" title="Managing Memory"><span class="secnum">26</span> Managing Memory</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-weak-ref-objects" title="WeakRef Objects"><span class="secnum">26.1</span> WeakRef Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-weak-ref-constructor" title="Properties of the WeakRef Constructor"><span class="secnum">26.1.2</span> Properties of the WeakRef Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-weakref-%symbol.custommatcher%" title="WeakRef [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">26.1.2.2</span> WeakRef [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-finalization-registry-objects" title="FinalizationRegistry Objects"><span class="secnum">26.2</span> FinalizationRegistry Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-finalization-registry-constructor" title="Properties of the FinalizationRegistry Constructor"><span class="secnum">26.2.2</span> Properties of the FinalizationRegistry Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-finalizationregistry-%symbol.custommatcher%" title="FinalizationRegistry [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">26.2.2.2</span> FinalizationRegistry [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-control-abstraction-objects" title="Control Abstraction Objects"><span class="secnum">27</span> Control Abstraction Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-promise-objects" title="Promise Objects"><span class="secnum">27.2</span> Promise Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-promise-constructor" title="Properties of the Promise Constructor"><span class="secnum">27.2.4</span> Properties of the Promise Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-promise-%symbol.custommatcher%" title="Promise [ %Symbol.customMatcher% ] ( subject, hint )"><span class="secnum">27.2.4.9</span> Promise [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-reflection" title="Reflection"><span class="secnum">28</span> Reflection</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-proxy-objects" title="Proxy Objects"><span class="secnum">28.2</span> Proxy Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-proxy-constructor" title="The Proxy Constructor"><span class="secnum">28.2.1</span> The Proxy Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-proxy-%symbol.custommatcher%" title="Proxy [ %Symbol.customMatcher% ] ( )"><span class="secnum">28.2.1.2</span> Proxy [ %Symbol.customMatcher% ] ( )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-pattern-matching" title="Pattern Matching"><span class="secnum">30</span> <ins>Pattern Matching</ins></a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-match-patterns" title="Match Patterns"><span class="secnum">30.1</span> Match Patterns</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-match-patterns-static-semantics-early-errors" title="Static Semantics: Early Errors"><span class="secnum">30.1.1</span> SS: Early Errors</a></li><li><span class="item-toggle-none"></span><a href="#sec-is-optional-pattern" title="Static Semantics: IsOptionalPattern"><span class="secnum">30.1.2</span> SS: IsOptionalPattern</a></li><li><span class="item-toggle-none"></span><a href="#sec-match-pattern-matches" title="Runtime Semantics: MatchPatternMatches"><span class="secnum">30.1.3</span> RS: MatchPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-primitive-pattern-matches" title="Runtime Semantics: PrimitivePatternMatches"><span class="secnum">30.1.4</span> RS: PrimitivePatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-variable-declaration-pattern-matches" title="Runtime Semantics: VariableDeclarationPatternMatches"><span class="secnum">30.1.5</span> RS: VariableDeclarationPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-member-expression-pattern-matches" title="Runtime Semantics: MemberExpressionPatternMatches"><span class="secnum">30.1.6</span> RS: MemberExpressionPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-object-pattern-matches" title="Runtime Semantics: ObjectPatternMatches"><span class="secnum">30.1.7</span> RS: ObjectPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-object-pattern-inner-matches" title="Runtime Semantics: ObjectPatternInnerMatches"><span class="secnum">30.1.8</span> RS: ObjectPatternInnerMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-array-pattern-matches" title="Runtime Semantics: ArrayPatternMatches"><span class="secnum">30.1.9</span> RS: ArrayPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-list-pattern-matches" title="Runtime Semantics: ListPatternMatches"><span class="secnum">30.1.10</span> RS: ListPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-list-pattern-inner-matches" title="Runtime Semantics: ListPatternInnerMatches"><span class="secnum">30.1.11</span> RS: ListPatternInnerMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-unary-algebraic-pattern-matches" title="Runtime Semantics: UnaryAlgebraicPatternMatches"><span class="secnum">30.1.12</span> RS: UnaryAlgebraicPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-relational-pattern-matches" title="Runtime Semantics: RelationalPatternMatches"><span class="secnum">30.1.13</span> RS: RelationalPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-if-pattern-matches" title="Runtime Semantics: IfPatternMatches"><span class="secnum">30.1.14</span> RS: IfPatternMatches</a></li><li><span class="item-toggle-none"></span><a href="#sec-combined-match-pattern-matches" title="Runtime Semantics: CombinedMatchPatternMatches"><span class="secnum">30.1.15</span> RS: CombinedMatchPatternMatches</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-match-expression" title="The match Expression"><span class="secnum">30.2</span> The <code>match</code> Expression</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-match-expression-static-semantics-early-errors" title="Static Semantics: Early Errors"><span class="secnum">30.2.1</span> SS: Early Errors</a></li><li><span class="item-toggle-none"></span><a href="#sec-match-expression-runtime-semantics-evaluation" title="Runtime Semantics: Evaluation"><span class="secnum">30.2.2</span> RS: Evaluation</a></li><li><span class="item-toggle-none"></span><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" title="Runtime Semantics: MatchExpressionClausesEvaluation"><span class="secnum">30.2.3</span> RS: MatchExpressionClausesEvaluation</a></li><li><span class="item-toggle-none"></span><a href="#sec-match-expression-clause-runtime-semantics-evaluation" title="Runtime Semantics: MatchExpressionClauseEvaluation"><span class="secnum">30.2.4</span> RS: MatchExpressionClauseEvaluation</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-abstract-operations-for-pattern-matching" title="Abstract Operations for Pattern Matching"><span class="secnum">30.3</span> Abstract Operations for Pattern Matching</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-invoke-custom-matcher" title="InvokeCustomMatcher ( matcher, subject, cacheGroup, kind, receiver )"><span class="secnum">30.3.1</span> InvokeCustomMatcher ( <var>matcher</var>, <var>subject</var>, <var>cacheGroup</var>, <var>kind</var>, <var>receiver</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-validatecustommatcherhint" title="ValidateCustomMatcherHint ( hint [ , kind ] )"><span class="secnum">30.3.2</span> ValidateCustomMatcherHint ( <var>hint</var> [ , <var>kind</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-creatematchcache" title="CreateMatchCache ( )"><span class="secnum">30.3.3</span> CreateMatchCache ( )</a></li><li><span class="item-toggle-none"></span><a href="#sec-get-match-cache" title="GetMatchCache ( subject, cacheGroup )"><span class="secnum">30.3.4</span> GetMatchCache ( <var>subject</var>, <var>cacheGroup</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-has-property-cached" title="HasPropertyCached ( subject, cacheGroup, propertyName )"><span class="secnum">30.3.5</span> HasPropertyCached ( <var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-get-cached" title="GetCached ( subject, cacheGroup, propertyName )"><span class="secnum">30.3.6</span> GetCached ( <var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-get-iterator-cached" title="GetIteratorCached ( subject, cacheGroup )"><span class="secnum">30.3.7</span> GetIteratorCached ( <var>subject</var>, <var>cacheGroup</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-iterator-step-cached" title="IteratorStepCached ( iterator, cacheGroup )"><span class="secnum">30.3.8</span> IteratorStepCached ( <var>iterator</var>, <var>cacheGroup</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-get-iterator-nth-value-cached" title="GetIteratorNthValueCached ( iterator, cacheGroup, n )"><span class="secnum">30.3.9</span> GetIteratorNthValueCached ( <var>iterator</var>, <var>cacheGroup</var>, <var>n</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-finish-list-match" title="FinishListMatch ( iterator, cacheGroup, expectedLength )"><span class="secnum">30.3.10</span> FinishListMatch ( <var>iterator</var>, <var>cacheGroup</var>, <var>expectedLength</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-finish-match" title="FinishMatch ( matchCompletion, cacheGroup )"><span class="secnum">30.3.11</span> FinishMatch ( <var>matchCompletion</var>, <var>cacheGroup</var> )</a></li></ol></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-grammar-summary" title="Grammar Summary"><span class="secnum">A</span> Grammar Summary</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-expressions" title="Expressions"><span class="secnum">A.1</span> Expressions</a></li><li><span class="item-toggle-none"></span><a href="#sec-annex-match-patterns" title="Patterns"><span class="secnum">A.9</span> Patterns</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">B</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 1 Draft / September 7, 2024</h1><h1 class="title">Pattern Matching</h1>
<style>
  #welcome .secnum, [title="Welcome"] .secnum {
    display: none;
  }
  emu-note[code] > .note, #welcome > h1 {
    font-size: 0;
  }
  emu-note[code] > .note::before {
    content: "Example";
    font-size: 18px;
  }
  emu-note[code] pre {
    margin: 0;
  }
  pre.inline {
    display: inline;
  }
  pre.inline code {
    display: inline;
    font-style: italic;
    text-decoration: underline;
  }
  body.folded .fold, body.folded .todo {
    display: none;
  }
  .show-ao-annotations a.e-user-code::before, .show-ao-annotations span.e-user-code::before {
    display: inline-block;
  }
  #sec-todos {
    border-left: 5px solid #ff6600;
    padding: 0.5em;
    background: #ffeedd;
  }
  emu-intro {
    margin-top: 1em !important;
  }
  [role="button"] {
    cursor: pointer;
  }
</style>

<emu-intro id="welcome">
  <h1>Welcome</h1>

  <emu-intro id="sec-todos">
    <h1 class="attributes-tag">TODOs</h1>
    <ul>
      <li>
        Scope and bindings
        <ul>
          <li>Basic case.</li>
          <li>Work with <code>for</code> loop (<emu-xref aoid="CreatePerIterationEnvironment"><a href="https://tc39.es/ecma262/#sec-createperiterationenvironment">CreatePerIterationEnvironment</a></emu-xref>).</li>
          <li>Work with function parameters.</li>
        </ul>
      </li>
    </ul>
  </emu-intro>

  <emu-intro id="sec-nav">
      <h1>Introduction</h1>
      <p>This specification consists of the following parts:</p>
      <ul>
        <li><emu-xref href="#sec-pattern-matching" id="_ref_0"><a href="#sec-pattern-matching">Patterns in pattern matching</a></emu-xref></li>
        <li>Interesting AOs:
          <ul>
            <li><emu-xref href="#sec-invoke-custom-matcher" title="" id="_ref_1"><a href="#sec-invoke-custom-matcher">InvokeCustomMatcher ( <var>matcher</var>, <var>subject</var>, <var>cacheGroup</var>, <var>kind</var>, <var>receiver</var> )</a></emu-xref></li>
            <li><emu-xref href="#sec-pattern-match-cache-note" id="_ref_2"><a href="#sec-pattern-match-cache-note">Cache semantics</a></emu-xref></li>
          </ul>
        </li>
        <li><emu-xref href="#sec-relational-operators" title="" id="_ref_3"><a href="#sec-relational-operators">The <code>is</code> expression</a></emu-xref></li>
        <li><emu-xref href="#sec-match-expression" title="" id="_ref_4"><a href="#sec-match-expression">The <code>match</code> Expression</a></emu-xref></li>
        <li>
          Non-trivial Built-in <emu-xref href="#sec-well-known-symbols" id="_ref_19"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> methods:
          <ul>
            <li><emu-xref href="#sec-function.prototype-%symbol.custommatcher%" title="" id="_ref_5"><a href="#sec-function.prototype-%symbol.custommatcher%">Function.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var>, <var>receiver</var> )</a></emu-xref></li>
            <li><emu-xref href="#sec-regexp.prototype-%symbol.custommatcher%" title="" id="_ref_6"><a href="#sec-regexp.prototype-%symbol.custommatcher%">RegExp.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></emu-xref></li>
          </ul>
        </li>
        <li>(TODO) Scope analysis changes: <emu-xref href="#sec-syntax-directed-operations" title="" id="_ref_7"><a href="#sec-syntax-directed-operations">Syntax-Directed Operations</a></emu-xref></li>
        <li><code>new</code> semantics changes:
          <emu-xref href="#sec-initializeinstance" id="_ref_8"><a href="#sec-initializeinstance">7.3.34</a></emu-xref>,
          <emu-xref href="#sec-weakly-hold-targets-processing-model" id="_ref_9"><a href="#sec-weakly-hold-targets-processing-model">9.10</a></emu-xref>, and
          <emu-xref href="#sec-runtime-semantics-classdefinitionevaluation" id="_ref_10"><a href="#sec-runtime-semantics-classdefinitionevaluation">15.7.14</a></emu-xref>
        </li>
        <li>
          Possible extensions:
          <emu-xref href="#sec-for-in-and-for-of-statements" title="" id="_ref_11"><a href="#sec-for-in-and-for-of-statements">The <code>for</code>-<code>in</code>, <code>for</code>-<code>of</code>, and <code>for</code>-<code>await</code>-<code>of</code> Statements</a></emu-xref> and
          <emu-xref href="#sec-try-statement" title="" id="_ref_12"><a href="#sec-try-statement">The <code>try</code> Statement</a></emu-xref>
        </li>
      </ul>
      <p>
        Trivia built-in matchers are folded.
        <a role="button" id="expand">Click to <span class="fold">not</span> show the trivia sections.</a>
      </p>
      <script defer="" async="" src="./assets/expand.js"></script>
  </emu-intro>

  <emu-intro id="sec-notes-layering">
    <h1>Layering</h1>
    <p>The pattern-matching champion group designed this proposal with a layering approach. It does not mean the proposal is an MVP. The champion group wishes to ship the proposal as a whole when possible, but we can drop some features if there is strong pushback from the committee.</p>
    <p>This approach allows the champion group to consider how all features combine and also how the proposal should behave if any of the features are missing.</p>
    <p>A feature will have a note if</p>
    <ul>
      <li>it is a convenient feature instead of a necessary feature.</li>
      <li>not all champion group members represent the hope to include it.</li>
    </ul>
  </emu-intro>
</emu-intro>

<emu-clause class="fold" id="sec-overview" number="4">
  <h1><span class="secnum">4</span> Overview</h1>

  <emu-clause id="sec-organization-of-this-specification" number="5">
    <h1><span class="secnum">4.5</span> Organization of This Specification</h1>
    <p><ins>Clause <emu-xref href="#sec-pattern-matching" id="_ref_13"><a href="#sec-pattern-matching">30</a></emu-xref> describes the pattern-matching feature.</ins></p>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-ecmascript-data-types-and-values" aoid="Type" number="6">
  <h1><span class="secnum">6</span> ECMAScript Data Types and Values</h1>

  <emu-clause id="sec-ecmascript-language-types">
    <h1><span class="secnum">6.1</span> ECMAScript Language Types</h1>

    <emu-clause id="sec-ecmascript-language-types-symbol-type" number="5">
      <h1><span class="secnum">6.1.5</span> The Symbol Type</h1>

      <emu-clause id="sec-well-known-symbols">
        <h1><span class="secnum">6.1.5.1</span> Well-Known Symbols</h1>
        <emu-table id="table-1" caption="Well-known Symbols"><figure><figcaption>Table 1: Well-known Symbols</figcaption>
          <table>
            <tbody>
            <tr>
              <th>
                Specification Name
              </th>
              <th>
                <var class="field">[[Description]]</var>
              </th>
              <th>
                Value and Purpose
              </th>
            </tr>
            <tr>
              <td>
                <ins><dfn tabindex="-1">%Symbol.customMatcher%</dfn></ins>
              </td>
              <td>
                <ins><code>"Symbol.customMatcher"</code></ins>
              </td>
              <td>
                <ins>A method that performs custom pattern matching semantics. Called by the semantics of the pattern-matching features.</ins>
              </td>
            </tr>
            </tbody>
          </table>
        </figure></emu-table>
      </emu-clause>
    </emu-clause>

    <emu-clause id="sec-object-internal-methods-and-internal-slots" number="7">
      <h1><span class="secnum">6.1.7</span> Object Internal Methods and Internal Slots</h1>
      <p><ins>All objects have an internal slot named <var class="field">[[ConstructedBy]]</var>, which is a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_20"><a href="#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>.
        This <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> represents the origin of the object. Initially, it is an empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</ins></p>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-abstract-operations" number="7">
  <h1><span class="secnum">7</span> Abstract Operations</h1>

  <emu-clause id="sec-operations-on-objects" number="3">
    <h1><span class="secnum">7.3</span> Operations on Objects</h1>

    <emu-clause oldids="sec-initializeinstanceelements" id="sec-initializeinstance" type="abstract operation" number="34" aoid="InitializeInstanceElements"><span id="sec-initializeinstanceelements"></span>
      <h1><span class="secnum">7.3.34</span> InitializeInstanceElements ( <var>O</var>, <var>constructor</var> )</h1>
      <p>The abstract operation InitializeInstanceElements takes arguments <var>O</var> (an Object) and <var>constructor</var> (an ECMAScript <emu-xref href="#function-object"><a href="https://tc39.es/ecma262/#function-object">function object</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> <emu-const>unused</emu-const> or a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li>Let <var>methods</var> be the value of <var>constructor</var>.<var class="field">[[PrivateMethods]]</var>.</li><li>For each <emu-xref href="#sec-privateelement-specification-type"><a href="https://tc39.es/ecma262/#sec-privateelement-specification-type">PrivateElement</a></emu-xref> <var>method</var> of <var>methods</var>, do<ol><li>Perform ?&nbsp;<emu-xref aoid="PrivateMethodOrAccessorAdd"><a href="https://tc39.es/ecma262/#sec-privatemethodoraccessoradd">PrivateMethodOrAccessorAdd</a></emu-xref>(<var>O</var>, <var>method</var>).</li></ol></li><li>Let <var>fields</var> be the value of <var>constructor</var>.<var class="field">[[Fields]]</var>.</li><li>For each element <var>fieldRecord</var> of <var>fields</var>, do<ol><li>Perform ?&nbsp;<emu-xref aoid="DefineField"><a href="https://tc39.es/ecma262/#sec-definefield" class="e-user-code">DefineField</a></emu-xref>(<var>O</var>, <var>fieldRecord</var>).</li></ol></li><li><ins>Append <var>constructor</var> to <var>O</var>.<var class="field">[[ConstructedBy]]</var>.</ins></li><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">Rename this abstract operation to <dfn tabindex="-1">InitializeInstance</dfn>.</div></emu-note>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="todo" id="sec-syntax-directed-operations">
  <h1><span class="secnum">8</span> Syntax-Directed Operations</h1>

  <emu-clause id="sec-syntax-directed-operations-scope-analysis" number="2">
    <h1><span class="secnum">8.2</span> Scope Analysis</h1>

    <emu-clause id="sec-static-semantics-boundnames" type="sdo" number="1" aoid="BoundNames">
      <h1><span class="secnum">8.2.1</span> Static Semantics: BoundNames</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> BoundNames takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of Strings.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-declarationpart" type="sdo" number="2" aoid="DeclarationPart">
      <h1><span class="secnum">8.2.2</span> Static Semantics: DeclarationPart</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> DeclarationPart takes no arguments and returns a <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Node</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-isconstantdeclaration" type="sdo" number="3" aoid="IsConstantDeclaration">
      <h1><span class="secnum">8.2.3</span> Static Semantics: IsConstantDeclaration</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IsConstantDeclaration takes no arguments and returns a Boolean.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-lexicallydeclarednames" type="sdo" number="4" aoid="LexicallyDeclaredNames">
      <h1><span class="secnum">8.2.4</span> Static Semantics: LexicallyDeclaredNames</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> LexicallyDeclaredNames takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of Strings.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-lexicallyscopeddeclarations" type="sdo" number="5" aoid="LexicallyScopedDeclarations">
      <h1><span class="secnum">8.2.5</span> Static Semantics: LexicallyScopedDeclarations</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> LexicallyScopedDeclarations takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Nodes</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-vardeclarednames" type="sdo" number="6" aoid="VarDeclaredNames">
      <h1><span class="secnum">8.2.6</span> Static Semantics: VarDeclaredNames</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> VarDeclaredNames takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of Strings.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-varscopeddeclarations" type="sdo" number="7" aoid="VarScopedDeclarations">
      <h1><span class="secnum">8.2.7</span> Static Semantics: VarScopedDeclarations</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> VarScopedDeclarations takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Nodes</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-toplevellexicallydeclarednames" type="sdo" number="8" aoid="TopLevelLexicallyDeclaredNames">
      <h1><span class="secnum">8.2.8</span> Static Semantics: TopLevelLexicallyDeclaredNames</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TopLevelLexicallyDeclaredNames takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of Strings.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-toplevellexicallyscopeddeclarations" type="sdo" number="9" aoid="TopLevelLexicallyScopedDeclarations">
      <h1><span class="secnum">8.2.9</span> Static Semantics: TopLevelLexicallyScopedDeclarations</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TopLevelLexicallyScopedDeclarations takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Nodes</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-toplevelvardeclarednames" type="sdo" number="10" aoid="TopLevelVarDeclaredNames">
      <h1><span class="secnum">8.2.10</span> Static Semantics: TopLevelVarDeclaredNames</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TopLevelVarDeclaredNames takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of Strings.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-static-semantics-toplevelvarscopeddeclarations" type="sdo" number="11" aoid="TopLevelVarScopedDeclarations">
      <h1><span class="secnum">8.2.11</span> Static Semantics: TopLevelVarScopedDeclarations</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TopLevelVarScopedDeclarations takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Nodes</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-syntax-directed-operations-miscellaneous" number="6">
    <h1><span class="secnum">8.6</span> Miscellaneous</h1>

    <emu-clause id="sec-runtime-semantics-bindinginitialization" type="sdo" number="2" aoid="BindingInitialization">
      <h1><span class="secnum">8.6.2</span> Runtime Semantics: BindingInitialization</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> BindingInitialization takes arguments <var>value</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_21"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>environment</var> (an <emu-xref href="#sec-environment-records"><a href="https://tc39.es/ecma262/#sec-environment-records">Environment Record</a></emu-xref> or <emu-val>undefined</emu-val>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> <emu-const>unused</emu-const> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-runtime-semantics-iteratorbindinginitialization" type="sdo" number="3" aoid="IteratorBindingInitialization">
      <h1><span class="secnum">8.6.3</span> Runtime Semantics: IteratorBindingInitialization</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IteratorBindingInitialization takes arguments <var>iteratorRecord</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>) and <var>environment</var> (an <emu-xref href="#sec-environment-records"><a href="https://tc39.es/ecma262/#sec-environment-records">Environment Record</a></emu-xref> or <emu-val>undefined</emu-val>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> <emu-const>unused</emu-const> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        TODO: Scope Analysis.
      </div></emu-note>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-executable-code-and-execution-contexts" number="9">
  <h1><span class="secnum">9</span> Executable Code and Execution Contexts</h1>

  <emu-clause id="sec-weakly-hold-targets-processing-model" oldids="sec-weakref-processing-model" number="10"><span id="sec-weakref-processing-model"></span>
    <h1><span class="secnum">9.10</span> Processing Model of <del>WeakRef and FinalizationRegistry</del><ins>weakly hold</ins> Targets</h1>

    <emu-clause id="sec-weakly-hold-execution" oldids="sec-weakref-execution" number="3"><span id="sec-weakref-execution"></span>
      <h1><span class="secnum">9.10.3</span> Execution</h1>
      <p>At any time, if a set of objects and/or symbols <var>S</var> is not <emu-xref href="#sec-liveness"><a href="https://tc39.es/ecma262/#sec-liveness">live</a></emu-xref>, an ECMAScript implementation may perform the following steps atomically:</p>
      <emu-alg><ol><li>For each element <var>value</var> of <var>S</var>, do<ol><li>For each <emu-xref href="#sec-weak-ref-constructor"><a href="https://tc39.es/ecma262/#sec-weak-ref-constructor">WeakRef</a></emu-xref> <var>ref</var> such that <var>ref</var>.<var class="field">[[WeakRefTarget]]</var> is <var>value</var>, do<ol><li>Set <var>ref</var>.<var class="field">[[WeakRefTarget]]</var> to <emu-const>empty</emu-const>.</li></ol></li><li>For each <emu-xref href="#sec-finalization-registry-constructor"><a href="https://tc39.es/ecma262/#sec-finalization-registry-constructor">FinalizationRegistry</a></emu-xref> <var>fg</var> such that <var>fg</var>.<var class="field">[[Cells]]</var> contains a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> <var>cell</var> such that <var>cell</var>.<var class="field">[[WeakRefTarget]]</var> is <var>value</var>, do<ol><li>Set <var>cell</var>.<var class="field">[[WeakRefTarget]]</var> to <emu-const>empty</emu-const>.</li><li>Optionally, perform <emu-xref aoid="HostEnqueueFinalizationRegistryCleanupJob"><a href="https://tc39.es/ecma262/#sec-host-cleanup-finalization-registry" class="e-user-code">HostEnqueueFinalizationRegistryCleanupJob</a></emu-xref>(<var>fg</var>).</li></ol></li><li>For each WeakMap <var>map</var> such that <var>map</var>.<var class="field">[[WeakMapData]]</var> contains a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> <var>r</var> such that <var>r</var>.<var class="field">[[Key]]</var> is <var>value</var>, do<ol><li>Set <var>r</var>.<var class="field">[[Key]]</var> to <emu-const>empty</emu-const>.</li><li>Set <var>r</var>.<var class="field">[[Value]]</var> to <emu-const>empty</emu-const>.</li></ol></li><li>For each WeakSet <var>set</var> such that <var>set</var>.<var class="field">[[WeakSetData]]</var> contains <var>value</var>, do<ol><li>Replace the element of <var>set</var>.<var class="field">[[WeakSetData]]</var> whose value is <var>value</var> with an element whose value is <emu-const>empty</emu-const>.</li></ol></li><li><ins>For each Object <var>o</var> such that <var>o</var>.<var class="field">[[ConstructedBy]]</var> contains <var>value</var>, do</ins><ol><li><ins>Remove <var>value</var> from <var>o</var>.<var class="field">[[ConstructedBy]]</var>.</ins></li></ol></li></ol></li></ol></emu-alg>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-ecmascript-language-lexical-grammar" number="12">
  <h1><span class="secnum">12</span> ECMAScript Language: Lexical Grammar</h1>

  <emu-clause id="sec-automatic-semicolon-insertion" number="10">
    <h1><span class="secnum">12.10</span> Automatic Semicolon Insertion</h1>

    <emu-clause id="sec-rules-of-automatic-semicolon-insertion" number="1">
      <h1><span class="secnum">12.10.1</span> Rules of Automatic Semicolon Insertion</h1>
      <emu-note><span class="note">Note</span><div class="note-contents">
        <p>The following are the additions of the restricted productions in the grammar:</p>
        <emu-grammar><emu-production name="RelationalExpression" params="In, Yield, Await">
    <emu-nt params="In, Yield, Await"><a href="#prod-RelationalExpression">RelationalExpression</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4sv6neua">
        <emu-nt id="_ref_194"><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>is</emu-t>
        <emu-nt id="_ref_195"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpression">MatchExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mvw1s1gm">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_196"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="MatchHead">
    <emu-nt><a href="#prod-MatchHead">MatchHead</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qvsbvt69">
        <emu-t>match</emu-t>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>(</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-interesting-cases-of-automatic-semicolon-insertion" number="3">
      <h1><span class="secnum">12.10.3</span> Interesting Cases of Automatic Semicolon Insertion</h1>

      <emu-clause id="sec-asi-cases-with-no-lineterminator-here" number="2">
        <h1><span class="secnum">12.10.3.2</span> Cases of Automatic Semicolon Insertion and “[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]”</h1>

        <emu-clause id="sec-no-lineterminator-here-automatic-semicolon-insertion-list" number="1">
          <h1><span class="secnum">12.10.3.2.1</span> List of Grammar Productions with Optional Operands and “[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]”</h1>
          <ul>
            <li><ins><emu-nt id="_ref_197"><a href="#prod-MatchExpression">MatchExpression</a></emu-nt>.</ins></li>
          </ul>
        </emu-clause>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-ecmascript-language-expressions" number="13">
  <h1><span class="secnum">13</span> ECMAScript Language: Expressions</h1>

  <emu-clause id="sec-primary-expression" number="2">
    <h1><span class="secnum">13.2</span> Primary Expression</h1>
    <h2>Syntax</h2>
    <emu-grammar type="definition"><emu-production name="PrimaryExpression" params="Yield, Await" id="prod-PrimaryExpression">
    <emu-nt params="Yield, Await"><a href="#prod-PrimaryExpression">PrimaryExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mbzy6lvr">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
    </emu-rhs>
    <ins><emu-rhs a="xhniddxr" id="prod-XSmG8KFu">
        <emu-nt params="?Yield, ?Await" id="_ref_198"><a href="#prod-MatchExpression">MatchExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs></ins>
</emu-production>
</emu-grammar>

    <emu-clause id="sec-primary-expression-match-expression" number="10">
      <h1><span class="secnum">13.2.10</span> Match Expression</h1>
      <p>See <emu-xref href="#sec-match-expression" title="" id="_ref_14"><a href="#sec-match-expression">The <code>match</code> Expression</a></emu-xref> for <emu-grammar><emu-production name="PrimaryExpression" collapsed="" class=" inline">
    <emu-nt><a href="#prod-PrimaryExpression">PrimaryExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hbnv2khd"><emu-nt id="_ref_199"><a href="#prod-MatchExpression">MatchExpression</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar></p>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-relational-operators" number="10">
    <h1><span class="secnum">13.10</span> Relational Operators</h1>
    <h2>Syntax</h2>
    <emu-grammar type="definition"><emu-production name="RelationalExpression" params="In, Yield, Await" id="prod-RelationalExpression">
    <emu-nt params="In, Yield, Await"><a href="#prod-RelationalExpression">RelationalExpression</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <ins><emu-rhs a="7pwutwad" id="prod-EdmoEhta">
        <emu-nt params="?In, ?Yield, ?Await" id="_ref_200"><a href="#prod-RelationalExpression">RelationalExpression</a><emu-mods><emu-params>[?In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>is</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_201"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs></ins>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> isOk = response is { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">status</span>: &gt; <span class="hljs-number">200</span> and &lt; <span class="hljs-number">400</span> };</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      This feature can be replaced by <emu-xref href="#sec-match-expression" title="" id="_ref_15"><a href="#sec-match-expression">The <code>match</code> Expression</a></emu-xref>.
      The code example above can be written as:
      <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> isOk = match (response) {
  { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">status</span>: &gt; <span class="hljs-number">200</span> and &lt; <span class="hljs-number">400</span> }: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">default</span>: <span class="hljs-literal">false</span>
};</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      We may need to use a non-<emu-xref href="#sec-keywords-and-reserved-words"><a href="https://tc39.es/ecma262/#sec-keywords-and-reserved-words">contextual keyword</a></emu-xref> like <code>~=</code> instead of a <emu-xref href="#sec-keywords-and-reserved-words"><a href="https://tc39.es/ecma262/#sec-keywords-and-reserved-words">contextual keyword</a></emu-xref> like <code>is</code>. See <a href="https://github.com/waldemarhorwat/syntax/blob/main/contextual-keywords.md?rgh-link-date=2024-09-06T16%3A43%3A25Z" data-print-href="">waldemarhorwat/syntax@main/contextual-keywords.md</a>
      and <a href="https://github.com/tc39/proposal-pattern-matching/issues/323" data-print-href="">Syntax effects on rest of the language</a>.
    </div></emu-note>

    <emu-clause id="sec-relational-operators-runtime-semantics-evaluation" number="1">
      <h1><span class="secnum">13.10.1</span> Runtime Semantics: Evaluation</h1>
      <emu-grammar><ins><emu-production name="RelationalExpression" collapsed="">
    <emu-nt><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uyg6vvvy">
        <emu-nt id="_ref_202"><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt>
        <emu-t>is</emu-t>
        <emu-nt id="_ref_203"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Let <var>lref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_204"><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt>.</li><li>Let <var>lval</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>lref</var>).</li><li>Let <var>cacheGroup</var> be <emu-xref aoid="CreateMatchCache" id="_ref_22"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref>().</li><li>Let <var>matchCompletion</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_23"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_205"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with argument <var>lval</var> and <var>cacheGroup</var>.</li><li>If <var>matchCompletion</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref>, then<ol><li>If <var>matchCompletion</var>.<var class="field">[[Value]]</var> is <emu-const>not-matched</emu-const>, set <var>matchCompletion</var> to <emu-xref aoid="NormalCompletion"><a href="https://tc39.es/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>false</emu-val>).</li><li>Else, set <var>matchCompletion</var> to <emu-xref aoid="NormalCompletion"><a href="https://tc39.es/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>true</emu-val>).</li></ol></li><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="FinishMatch" id="_ref_24"><a href="#sec-finish-match" class="e-user-code">FinishMatch</a></emu-xref>(<var>matchCompletion</var>, <var>cacheGroup</var>)).</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</li><li>Return <var>result</var>.</li></ol></emu-alg>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-ecmascript-language-statements-and-declarations" number="14">
  <h1><span class="secnum">14</span> ECMAScript Language: Statements and Declarations</h1>
  <h2>Syntax</h2>

  <emu-clause id="sec-iteration-statements" number="7">
    <h1><span class="secnum">14.7</span> Iteration Statements</h1>

    <emu-clause id="sec-for-in-and-for-of-statements">
      <h1><span class="secnum">14.7.1</span> The <code>for</code>-<code>in</code>, <code>for</code>-<code>of</code>, and <code>for</code>-<code>await</code>-<code>of</code> Statements</h1>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        It is possible to add pattern-matching to the <code>for</code> iteration statements. It might look like this:
        <pre><code class="javascript hljs"><span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> response <span class="hljs-keyword">of</span> responses) {
  <span class="hljs-keyword">if</span> (item is { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-keyword">let</span> body }) {
  }
}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> response is { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-keyword">let</span> body } <span class="hljs-keyword">of</span> responses) {
}
<span class="hljs-comment">// or</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> response <span class="hljs-keyword">of</span> responses matches { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-keyword">let</span> body }) {
}</code></pre>
      </div></emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-try-statement" number="14">
    <h1><span class="secnum">14.14</span> The <code>try</code> Statement</h1>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      It is possible to add pattern-matching to the <code>try</code> statement. It might look like this:
      <pre><code class="javascript hljs"><span class="hljs-keyword">try</span> { }
<span class="hljs-keyword">catch</span> (error) {
  <span class="hljs-keyword">if</span> (error is { <span class="hljs-attr">message</span>: <span class="hljs-regexp">/JSON/</span> }) { <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>; }
  <span class="hljs-keyword">throw</span> error;
}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">try</span> { }
<span class="hljs-keyword">catch</span> (error is { <span class="hljs-attr">message</span>: <span class="hljs-regexp">/JSON/</span> }) { <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>; }
<span class="hljs-comment">// unmatched error will be re-thrown.</span></code></pre>
    </div></emu-note>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-ecmascript-language-functions-and-classes" number="15">
  <h1><span class="secnum">15</span> ECMAScript Language: Functions and Classes</h1>

  <emu-clause id="sec-class-definitions" number="7">
    <h1><span class="secnum">15.7</span> Class Definitions</h1>

    <emu-clause id="sec-runtime-semantics-classdefinitionevaluation" type="sdo" number="14" aoid="ClassDefinitionEvaluation">
      <h1><span class="secnum">15.7.14</span> Runtime Semantics: ClassDefinitionEvaluation</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassDefinitionEvaluation takes arguments <var>classBinding</var> (a String or <emu-val>undefined</emu-val>) and <var>className</var> (a <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">property key</a></emu-xref> or a <emu-xref href="#sec-private-names"><a href="https://tc39.es/ecma262/#sec-private-names">Private Name</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a <emu-xref href="#function-object"><a href="https://tc39.es/ecma262/#function-object">function object</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        See <a href="https://github.com/tc39/ecma262/pull/3212/files" target="_blank" data-print-href="">Editorial: call MakeClassConstructor on default class constructor</a>.
      </div></emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause class="fold" id="sec-tail-position-calls" number="10">
    <h1><span class="secnum">15.10</span> Tail Position Calls</h1>

    <emu-clause id="sec-static-semantics-hascallintailposition" number="2" type="sdo" aoid="HasCallInTailPosition">
      <h1><span class="secnum">15.10.2</span> Static Semantics: HasCallInTailPosition</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> HasCallInTailPosition takes argument <var>call</var> (a <emu-nt><a href="https://tc39.es/ecma262/#prod-CallExpression">CallExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Node</a></emu-xref>, a <emu-nt><a href="https://tc39.es/ecma262/#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Node</a></emu-xref>, or an <emu-nt><a href="https://tc39.es/ecma262/#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">Parse Node</a></emu-xref>) and returns a Boolean. It is defined piecewise over the following productions:</p>
      <emu-grammar><ins><emu-production name="RelationalExpression" collapsed="">
    <emu-nt><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uyg6vvvy" id="prod-9oXzuZL6">
        <emu-nt id="_ref_206"><a href="#prod-RelationalExpression">RelationalExpression</a></emu-nt>
        <emu-t>is</emu-t>
        <emu-nt id="_ref_207"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="PrimaryExpression" collapsed="">
    <emu-nt><a href="#prod-PrimaryExpression">PrimaryExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hbnv2khd" id="prod-UB1LtDnR"><emu-nt id="_ref_208"><a href="#prod-MatchExpression">MatchExpression</a></emu-nt></emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_25"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_209"><a href="#prod-MatchExpression">MatchExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpression" collapsed="">
    <emu-nt><a href="#prod-MatchExpression">MatchExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="y2kk1jwh" id="prod-BHK6aZq8">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
        <emu-t>{</emu-t>
        <emu-nt id="_ref_210"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_26"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_211"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uzg4qni-" id="prod-YG9CRILW"><emu-nt id="_ref_212"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt></emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_27"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_213"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mxhusj8b" id="prod-O1ji-jbG">
        <emu-nt id="_ref_214"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-nt id="_ref_215"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Let <var>result</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_28"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_216"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with argument <var>call</var>.</li><li>If <var>result</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_29"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_217"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g1pmaudo" id="prod-ac1fz2Ib">
        <emu-nt id="_ref_218"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Let <var>result</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_30"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_219"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with argument <var>call</var>.</li><li>If <var>result</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_31"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xhzralk2" id="prod-4UejTJZU">
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_32"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
      <emu-grammar><ins><emu-production name="MatchExpressionClause" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="pjnnj8-j" id="prod-FYuYdt05">
        <emu-nt id="_ref_220"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production></ins>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_33"><a href="#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-fundamental-objects" number="20">
  <h1><span class="secnum">20</span> Fundamental Objects</h1>

  <emu-clause class="fold" id="sec-object-objects" number="1">
    <h1><span class="secnum">20.1</span> Object Objects</h1>

    <emu-clause id="sec-properties-of-the-object-constructor" number="2">
      <h1><span class="secnum">20.1.2</span> Properties of the Object Constructor</h1>

      <emu-clause id="sec-object-%symbol.custommatcher%" number="24">
        <h1><span class="secnum">20.1.2.24</span> Object [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_34"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-function-objects" number="2">
    <h1><span class="secnum">20.2</span> Function Objects</h1>

    <emu-clause id="sec-properties-of-the-function-constructor" number="2">
      <h1><span class="secnum">20.2.2</span> Properties of the Function Constructor</h1>

      <emu-clause id="sec-function-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">20.2.2.2</span> Function [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_35"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>Return <emu-xref aoid="IsCallable"><a href="https://tc39.es/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>subject</var>).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>

    <emu-clause id="sec-properties-of-the-function-prototype-object" number="3">
      <h1><span class="secnum">20.2.3</span> Properties of the Function Prototype Object</h1>

      <emu-clause id="sec-function.prototype-%symbol.custommatcher%" number="7">
        <h1><span class="secnum">20.2.3.7</span> Function.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var>, <var>receiver</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_36"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>Let <var>func</var> be the <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.es/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>func</var>) is false, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>subject</var>.<var class="field">[[ConstructedBy]]</var> contains <var>func</var>, return <emu-val>true</emu-val>.</li><li>If <var>func</var> does not have a <var class="field">[[IsClassConstructor]]</var> internal slot or <var>func</var>.<var class="field">[[IsClassConstructor]]</var> is <emu-val>false</emu-val>, return ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(<var>func</var>, <var>receiver</var>, « <var>subject</var>, <var>hint</var>&nbsp;»).</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-comment">// For non-class functions.</span>
[] is <span class="hljs-title class_">Array</span>.<span class="hljs-property">isArray</span>; <span class="hljs-comment">// true, by Array.isArray(expr)</span>

<span class="hljs-comment">// For objects created by `new`, it uses private-field-like semantics.</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyError</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Error</span> {}
<span class="hljs-keyword">const</span> myError = <span class="hljs-keyword">new</span> <span class="hljs-title class_">MyError</span>();
myError is <span class="hljs-title class_">MyError</span>; <span class="hljs-comment">// true</span>
myError is <span class="hljs-title class_">Error</span>; <span class="hljs-comment">// true</span>
<span class="hljs-title class_">Object</span>.<span class="hljs-title function_">create</span>(<span class="hljs-title class_">MyError</span>.<span class="hljs-property"><span class="hljs-keyword">prototype</span></span>) is <span class="hljs-title class_">MyError</span>; <span class="hljs-comment">// false</span>

<span class="hljs-comment">// Also works for normal functions</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">ES5StyleClass</span>(<span class="hljs-params"></span>) {}
<span class="hljs-keyword">new</span> <span class="hljs-title function_">ES5StyleClass</span>() is ES5StyleClass; <span class="hljs-comment">// true</span>
<span class="hljs-title class_">Object</span>.<span class="hljs-title function_">create</span>(ES5StyleClass.<span class="hljs-property"><span class="hljs-keyword">prototype</span></span>) is ES5StyleClass; <span class="hljs-comment">// false</span></code></pre></div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          <p>This does not work with ES5 style class inherit.</p>
          <pre><code class="javascript hljs"><span class="hljs-keyword">function</span> <span class="hljs-title function_">MyError</span>(<span class="hljs-params"></span>) {
  <span class="hljs-title class_">Error</span>.<span class="hljs-title function_">call</span>(<span class="hljs-variable language_">this</span>);
}
<span class="hljs-title class_">MyError</span>.<span class="hljs-property"><span class="hljs-keyword">prototype</span></span> = <span class="hljs-title class_">Object</span>.<span class="hljs-title function_">create</span>(<span class="hljs-title class_">Error</span>.<span class="hljs-property"><span class="hljs-keyword">prototype</span></span>);
<span class="hljs-keyword">var</span> error = <span class="hljs-keyword">new</span> <span class="hljs-title class_">MyError</span>();
error is <span class="hljs-title class_">MyError</span>; <span class="hljs-comment">// true</span>
error is <span class="hljs-title class_">Error</span>; <span class="hljs-comment">// false</span></code></pre>
        </div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          <p>Not everyone in the champion group agrees with private-field-like brand check semantics.</p>
          <p>
            There are
            <a href="https://github.com/tc39/proposal-pattern-matching/pull/293#issuecomment-1725097699" target="_blank" data-print-href="">performance concerns</a>,
            <a href="https://github.com/tc39/proposal-pattern-matching/pull/293#issuecomment-1725097699" target="_blank" data-print-href="">"hackable" concerns</a>, and
            <a href="https://github.com/tc39/proposal-pattern-matching/pull/293#issuecomment-1725097699" target="_blank" data-print-href="">interaction
              with %Symbol.hasInstance% concerns</a>.
          </p>
          <p>Another approach is to use the <code>instanceof</code> semantics.</p>
        </div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause class="fold" id="sec-boolean-objects" number="3">
    <h1><span class="secnum">20.3</span> Boolean Objects</h1>

    <emu-clause id="sec-properties-of-the-boolean-constructor" number="2">
      <h1><span class="secnum">20.3.2</span> Properties of the Boolean Constructor</h1>

      <emu-clause id="sec-boolean-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">20.3.2.2</span> Boolean [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_37"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-boolean-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-boolean-type">is not a Boolean</a></emu-xref> and does not have a <var class="field">[[BooleanData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-boolean-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-boolean-type">is a Boolean</a></emu-xref>, return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>.<var class="field">[[BooleanData]]</var>&nbsp;»).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      Another approach is to ignore boxed primitives and only match primitive values.
    </div></emu-note>
  </emu-clause>

  <emu-clause class="fold" id="sec-symbol-objects" number="4">
    <h1><span class="secnum">20.4</span> Symbol Objects</h1>

    <emu-clause id="sec-properties-of-the-symbol-constructor" number="2">
      <h1><span class="secnum">20.4.2</span> Properties of the Symbol Constructor</h1>

      <emu-clause id="sec-symbol.custommatcher" number="17">
        <h1><span class="secnum">20.4.2.17</span> Symbol.customMatcher</h1>
        <p>The initial value of <code>Symbol.customMatcher</code> is the well-known symbol <emu-xref href="#sec-well-known-symbols" id="_ref_38"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> (<emu-xref href="#table-well-known-symbols"><a href="https://tc39.es/ecma262/#table-well-known-symbols">Table 1</a></emu-xref>).</p>
        <p>This property has the attributes { <var class="field">[[Writable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val> }.</p>
      </emu-clause>

      <emu-clause id="sec-symbol-%symbol.custommatcher%">
        <h1><span class="secnum">20.4.2.18</span> Symbol [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_39"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-symbol-type" id="_ref_40"><a href="#sec-ecmascript-language-types-symbol-type">is not a Symbol</a></emu-xref> and does not have a <var class="field">[[SymbolData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-symbol-type" id="_ref_41"><a href="#sec-ecmascript-language-types-symbol-type">is a Symbol</a></emu-xref>, return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>.<var class="field">[[SymbolData]]</var>&nbsp;»).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      Another approach is to ignore boxed primitives and only match primitive values.
    </div></emu-note>
  </emu-clause>

  <emu-clause class="fold" id="sec-error-objects" number="5">
    <h1><span class="secnum">20.5</span> Error Objects</h1>

    <emu-clause id="sec-error-constructor" number="1">
      <h1><span class="secnum">20.5.1</span> The Error Constructor</h1>

      <emu-clause id="sec-error-message">
        <h1><span class="secnum">20.5.1.1</span> Error ( <var>message</var> [ , <var>options</var> ] )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, let <var>newTarget</var> be the <emu-xref href="#active-function-object"><a href="https://tc39.es/ecma262/#active-function-object">active function object</a></emu-xref>; else let <var>newTarget</var> be NewTarget.</li><li>Let <var>O</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(<var>newTarget</var>, <emu-val>"%Error.prototype%"</emu-val>, « <var class="field">[[ErrorData]]</var>&nbsp;»).</li><li><ins>Set <var>O</var>.<var class="field">[[ErrorData]]</var> to <emu-val>"Error"</emu-val>.</ins></li><li>If <var>message</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>msg</var> be ?&nbsp;<emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>message</var>).</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>O</var>, <emu-val>"message"</emu-val>, <var>msg</var>).</li></ol></li><li>Perform ?&nbsp;<emu-xref aoid="InstallErrorCause"><a href="https://tc39.es/ecma262/#sec-installerrorcause" class="e-user-code">InstallErrorCause</a></emu-xref>(<var>O</var>, <var>options</var>).</li><li>Return <var>O</var>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>

    <emu-clause id="sec-properties-of-the-error-constructors" number="2">
      <h1><span class="secnum">20.5.2</span> Properties of the Error Constructor</h1>

      <emu-clause id="sec-error-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">20.5.2.2</span> Error [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
          <p>This function performs the following steps when called:</p>
          <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_42"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[ErrorData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        It is possible to provide extractor semantics for Error matchers.
        <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is <span class="hljs-title class_">Error</span>(<span class="hljs-keyword">let</span> message, { <span class="hljs-keyword">let</span> cause })) {}</code></pre>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-properties-of-error-instances" number="4">
      <h1><span class="secnum">20.5.4</span> Properties of Error Instances</h1>
      <p>Error instances are <emu-xref href="#ordinary-object"><a href="https://tc39.es/ecma262/#ordinary-object">ordinary objects</a></emu-xref> that inherit properties from the <emu-xref href="#sec-properties-of-the-error-prototype-object"><a href="https://tc39.es/ecma262/#sec-properties-of-the-error-prototype-object">Error prototype object</a></emu-xref> and have an
        <var class="field">[[ErrorData]]</var> internal slot whose value is <del><emu-val>undefined</emu-val></del> <ins>a String</ins>. The only specified uses of
        <var class="field">[[ErrorData]]</var> is to identify Error, AggregateError, and <var>NativeError</var> instances as Error objects within
        <code>Object.prototype.toString</code> <ins>and their <emu-xref href="#sec-well-known-symbols" id="_ref_43"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> methods</ins>.</p>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        Rename this internal slot to <var class="field">[[ErrorKind]]</var>.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-nativeerror-object-structure" number="6">
      <h1><span class="secnum">20.5.6</span> <var>NativeError</var> Object Structure</h1>

      <emu-clause id="sec-nativeerror-constructors" number="1">
        <h1><span class="secnum">20.5.6.1</span> The <var>NativeError</var> Constructors</h1>

        <emu-clause id="sec-nativeerror" number="1">
          <h1><span class="secnum">20.5.6.1.1</span> <var>NativeError</var> ( <var>message</var> [ , <var>options</var> ] )</h1>
          <p>Each <var>NativeError</var> function performs the following steps when called:</p>
          <emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, let <var>newTarget</var> be the <emu-xref href="#active-function-object"><a href="https://tc39.es/ecma262/#active-function-object">active function object</a></emu-xref>; else let <var>newTarget</var> be NewTarget.</li><li>Let <var>O</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(<var>newTarget</var>, <code>"%<var>NativeError</var>.prototype%"</code>, « <var class="field">[[ErrorData]]</var>&nbsp;»).</li><li><ins>Set <var>O</var>.<var class="field">[[ErrorData]]</var> to <var>NativeError</var>.</ins></li><li>If <var>message</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>msg</var> be ?&nbsp;<emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>message</var>).</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>O</var>, <emu-val>"message"</emu-val>, <var>msg</var>).</li></ol></li><li>Perform ?&nbsp;<emu-xref aoid="InstallErrorCause"><a href="https://tc39.es/ecma262/#sec-installerrorcause" class="e-user-code">InstallErrorCause</a></emu-xref>(<var>O</var>, <var>options</var>).</li><li>Return <var>O</var>.</li></ol></emu-alg>
        </emu-clause>
      </emu-clause>

      <emu-clause id="sec-properties-of-the-nativeerror-constructors" number="2">
        <h1><span class="secnum">20.5.6.2</span> Properties of the <var>NativeError</var> Constructors</h1>

        <emu-clause id="sec-nativeerror-%symbol.custommatcher%" number="2">
          <h1><span class="secnum">20.5.6.2.2</span> <var>NativeError</var> [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
          <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_44"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[ErrorData]]</var> internal slot or <var>subject</var>.<var class="field">[[ErrorData]]</var> is not <var>NativeError</var>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
        </emu-clause>
      </emu-clause>

      <emu-clause id="sec-properties-of-nativeerror-instances" number="4">
        <h1><span class="secnum">20.5.6.4</span> Properties of <var>NativeError</var> Instances</h1>
        <p><var>NativeError</var> instances are <emu-xref href="#ordinary-object"><a href="https://tc39.es/ecma262/#ordinary-object">ordinary objects</a></emu-xref> that inherit properties from their <var>NativeError</var> prototype object and
          have an <var class="field">[[ErrorData]]</var> internal slot whose value is <del><emu-val>undefined</emu-val></del> <ins>a String</ins>. The only specified use
          of <var class="field">[[ErrorData]]</var> is by <code>Object.prototype.toString</code> (<emu-xref href="#sec-object.prototype.tostring"><a href="https://tc39.es/ecma262/#sec-object.prototype.tostring">20.1.3.6</a></emu-xref>)
          <ins>and their <emu-xref href="#sec-well-known-symbols" id="_ref_45"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> methods</ins> to identify Error, AggregateError, or <var>NativeError</var> instances.
        </p>
      </emu-clause>
    </emu-clause>

    <emu-clause id="sec-aggregate-error-objects" number="7">
      <h1><span class="secnum">20.5.7</span> AggregateError Objects</h1>

      <emu-clause id="sec-aggregate-error-constructor" number="1">
        <h1><span class="secnum">20.5.7.1</span> The AggregateError Constructor</h1>

        <emu-clause id="sec-aggregate-error">
          <h1><span class="secnum">20.5.7.1.1</span> AggregateError ( <var>errors</var>, <var>message</var> [ , <var>options</var> ] )</h1>
          <p>This function performs the following steps when called:</p>
          <emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, let <var>newTarget</var> be the <emu-xref href="#active-function-object"><a href="https://tc39.es/ecma262/#active-function-object">active function object</a></emu-xref>; else let <var>newTarget</var> be NewTarget.</li><li>Let <var>O</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(<var>newTarget</var>, <emu-val>"%AggregateError.prototype%"</emu-val>, « <var class="field">[[ErrorData]]</var>&nbsp;»).</li><li><ins>Set <var>O</var>.<var class="field">[[ErrorData]]</var> to <emu-val>"AggregateError"</emu-val>.</ins></li><li>If <var>message</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>msg</var> be ?&nbsp;<emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>message</var>).</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>O</var>, <emu-val>"message"</emu-val>, <var>msg</var>).</li></ol></li><li>Perform ?&nbsp;<emu-xref aoid="InstallErrorCause"><a href="https://tc39.es/ecma262/#sec-installerrorcause" class="e-user-code">InstallErrorCause</a></emu-xref>(<var>O</var>, <var>options</var>).</li><li>Let <var>errorsList</var> be ?&nbsp;<emu-xref aoid="IteratorToList"><a href="https://tc39.es/ecma262/#sec-iteratortolist" class="e-user-code">IteratorToList</a></emu-xref>(? <emu-xref aoid="GetIterator"><a href="https://tc39.es/ecma262/#sec-getiterator" class="e-user-code">GetIterator</a></emu-xref>(<var>errors</var>, <emu-const>sync</emu-const>)).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>O</var>, <emu-val>"errors"</emu-val>, PropertyDescriptor { <var class="field">[[Configurable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Value]]</var>: <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>errorsList</var>)&nbsp;}).</li><li>Return <var>O</var>.</li></ol></emu-alg>
        </emu-clause>
      </emu-clause>

      <emu-clause id="sec-properties-of-the-aggregate-error-constructors" number="2">
        <h1><span class="secnum">20.5.7.2</span> Properties of the AggregateError Constructor</h1>

        <emu-clause id="sec-aggregate-error-%symbol.custommatcher%" number="2">
          <h1><span class="secnum">20.5.7.2.2</span> AggregateError [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
          <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_46"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[ErrorData]]</var> internal slot or <var>subject</var>.<var class="field">[[ErrorData]]</var> is not <emu-val>"AggregateError"</emu-val>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
        </emu-clause>
      </emu-clause>

      <emu-clause id="sec-properties-of-aggregate-error-instances" number="4">
        <h1><span class="secnum">20.5.7.4</span> Properties of AggregateError Instances</h1>
        <p>AggregateError instances are <emu-xref href="#ordinary-object"><a href="https://tc39.es/ecma262/#ordinary-object">ordinary objects</a></emu-xref> that inherit properties from their <emu-xref href="#sec-properties-of-the-aggregate-error-prototype-objects"><a href="https://tc39.es/ecma262/#sec-properties-of-the-aggregate-error-prototype-objects">AggregateError prototype object</a></emu-xref> and
          have an <var class="field">[[ErrorData]]</var> internal slot whose value is <del><emu-val>undefined</emu-val></del> <ins>a String</ins>. The only specified use
          of <var class="field">[[ErrorData]]</var> is by <code>Object.prototype.toString</code> (<emu-xref href="#sec-object.prototype.tostring"><a href="https://tc39.es/ecma262/#sec-object.prototype.tostring">20.1.3.6</a></emu-xref>)
          <ins>and their <emu-xref href="#sec-well-known-symbols" id="_ref_47"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> methods</ins> to identify Error, AggregateError, or <var>NativeError</var> instances.
        </p>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-numbers-and-dates" number="21">
  <h1><span class="secnum">21</span> Numbers and Dates</h1>

  <emu-clause id="sec-number-objects" number="1">
    <h1><span class="secnum">21.1</span> Number Objects</h1>

    <emu-clause id="sec-properties-of-the-number-constructor" number="2">
      <h1><span class="secnum">21.1.2</span> Properties of the Number Constructor</h1>

      <emu-clause id="sec-number-%symbol.custommatcher%" number="16">
        <h1><span class="secnum">21.1.2.16</span> Number [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_48"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-number-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type">is not a Number</a></emu-xref> and does not have a <var class="field">[[NumberData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-number-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type">is a Number</a></emu-xref>, return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>.<var class="field">[[NumberData]]</var>&nbsp;»).</li></ol></emu-alg>
      </emu-clause>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        Another approach is to ignore boxed primitives and only match primitive values.
      </div></emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-bigint-objects" number="2">
    <h1><span class="secnum">21.2</span> BigInt Objects</h1>

    <emu-clause id="sec-properties-of-the-bigint-constructor" number="2">
      <h1><span class="secnum">21.2.2</span> Properties of the BigInt Constructor</h1>

      <emu-clause id="sec-bigint-%symbol.custommatcher%" number="4">
        <h1><span class="secnum">21.2.2.4</span> BigInt [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_49"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-bigint-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-bigint-type">is not a BigInt</a></emu-xref> and does not have a <var class="field">[[BigIntData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-bigint-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-bigint-type">is a BigInt</a></emu-xref>, return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>.<var class="field">[[BigIntData]]</var>&nbsp;»).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      Another approach is to ignore boxed primitives and only match primitive values.
    </div></emu-note>
  </emu-clause>

  <emu-clause id="sec-date-objects" number="4">
    <h1><span class="secnum">21.4</span> Date Objects</h1>

    <emu-clause id="sec-properties-of-the-date-constructor" number="3">
      <h1><span class="secnum">21.4.3</span> Properties of the Date Constructor</h1>

      <emu-clause id="sec-date-%symbol.custommatcher%" number="5">
        <h1><span class="secnum">21.4.3.5</span> Date [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_50"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[DateValue]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-text-processing" number="22">
  <h1><span class="secnum">22</span> Text Processing</h1>

  <emu-clause id="sec-string-objects" number="1">
    <h1><span class="secnum">22.1</span> String Objects</h1>

    <emu-clause id="sec-properties-of-the-string-constructor" number="2">
      <h1><span class="secnum">22.1.2</span> Properties of the String Constructor</h1>

      <emu-clause id="sec-string-%symbol.custommatcher%" number="5">
        <h1><span class="secnum">22.1.2.5</span> String [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_51"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref> and does not have a <var class="field">[[StringData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>If <var>subject</var> <emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is a String</a></emu-xref>, return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>.<var class="field">[[StringData]]</var>&nbsp;»).</li></ol></emu-alg>
      </emu-clause>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        Another approach is to ignore boxed primitives and only match primitive values.
      </div></emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-regexp-regular-expression-objects" number="2">
    <h1><span class="secnum">22.2</span> RegExp (Regular Expression) Objects</h1>

    <emu-clause id="sec-properties-of-the-regexp-constructor" number="5">
      <h1><span class="secnum">22.2.5</span> Properties of the RegExp Constructor</h1>

      <emu-clause id="sec-regexp-%symbol.custommatcher%" number="3">
        <h1><span class="secnum">22.2.5.3</span> RegExp [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_52"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If ?&nbsp;<emu-xref aoid="IsRegExp"><a href="https://tc39.es/ecma262/#sec-isregexp" class="e-user-code">IsRegExp</a></emu-xref>(<var>subject</var>) is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
        <emu-note><span class="note">Note</span><div class="note-contents">
          <emu-xref aoid="IsRegExp"><a href="https://tc39.es/ecma262/#sec-isregexp">IsRegExp</a></emu-xref> returns <emu-val>true</emu-val> for objects that have a truthy <emu-xref href="#sec-well-known-symbols" id="_ref_53"><a href="#sec-well-known-symbols">%Symbol.match%</a></emu-xref> property. Do we want this?
        </div></emu-note>
      </emu-clause>
    </emu-clause>

    <emu-clause id="sec-properties-of-the-regexp-prototype-object" number="6">
      <h1><span class="secnum">22.2.6</span> Properties of the RegExp Prototype Object</h1>

      <emu-clause id="sec-regexp.prototype-%symbol.custommatcher%" number="20">
        <h1><span class="secnum">22.2.6.20</span> RegExp.prototype [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_54"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>Let <var>regexp</var> be <emu-val>this</emu-val> value.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>regexp</var>, <emu-val>"test"</emu-val>), <var>regexp</var>, « <var>subject</var>&nbsp;»).</li><li>Let <var>isRegExp</var> be ?&nbsp;<emu-xref aoid="IsRegExp"><a href="https://tc39.es/ecma262/#sec-isregexp" class="e-user-code">IsRegExp</a></emu-xref>(<var>regexp</var>).</li><li>If <var>isRegExp</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>flags</var> be ?&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>regexp</var>, "flags").</li><li>Perform ?&nbsp;<emu-xref aoid="RequireObjectCoercible"><a href="https://tc39.es/ecma262/#sec-requireobjectcoercible">RequireObjectCoercible</a></emu-xref>(<var>flags</var>).</li><li>If ?&nbsp;<emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>flags</var>) contains <emu-val>g</emu-val>, then<ol><li>Let <var>iterator</var> be ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>regexp</var>, <emu-xref href="#sec-well-known-symbols" id="_ref_55"><a href="#sec-well-known-symbols">%Symbol.matchAll%</a></emu-xref>), <var>regexp</var>, « <var>subject</var>&nbsp;»).</li><li>Let <var>array</var> be ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(<emu-xref href="#sec-array.from"><a href="https://tc39.es/ecma262/#sec-array.from">%Array.from%</a></emu-xref>, <emu-xref href="#sec-array-constructor"><a href="https://tc39.es/ecma262/#sec-array-constructor">%Array%</a></emu-xref>, « <var>iterator</var>&nbsp;»).</li><li>If !&nbsp;<emu-xref aoid="LengthOfArrayLike"><a href="https://tc39.es/ecma262/#sec-lengthofarraylike">LengthOfArrayLike</a></emu-xref>(<var>array</var>) is 0, return <emu-val>false</emu-val>.</li><li>Return <var>array</var>.</li></ol></li></ol></li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>regexp</var>, <emu-xref href="#sec-well-known-symbols" id="_ref_56"><a href="#sec-well-known-symbols">%Symbol.match%</a></emu-xref>), <var>regexp</var>, « <var>subject</var>&nbsp;»).</li><li>If <var>result</var> is <emu-val>null</emu-val>, return <emu-val>false</emu-val>.</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>result</var>&nbsp;»).</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents">
          <pre><code class="javascript hljs"><span class="hljs-keyword">let</span> regex = <span class="hljs-regexp">/(?&lt;id&gt;\d+)-?/g</span>
<span class="hljs-string">'012-345'</span> is <span class="hljs-title function_">regex</span>([<span class="hljs-string">"012-"</span>, <span class="hljs-string">"012"</span>], { <span class="hljs-attr">groups</span>: { <span class="hljs-attr">id</span>: <span class="hljs-string">"345"</span> } });
<span class="hljs-comment">// true, match with %Symbol.matchAll%</span>

<span class="hljs-keyword">let</span> regex2 = <span class="hljs-regexp">/(?&lt;id&gt;\d+)-?/</span>
<span class="hljs-string">'012-345'</span> is <span class="hljs-title function_">regex</span>({ <span class="hljs-attr">groups</span>: { <span class="hljs-attr">id</span>: <span class="hljs-string">"012"</span> } });
<span class="hljs-comment">// true, match with %Symbol.match%</span></code></pre>
        </div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          The <emu-val>"flags"</emu-val> property in this algorithm is accessed twice, this is not ideal.
          Another access is
          in <emu-xref href="#sec-regexp-prototype-%symbol.matchall%" title=""><a href="https://tc39.es/ecma262/#sec-regexp-prototype-%symbol.matchall%">RegExp.prototype [ %Symbol.matchAll% ] ( <var>string</var> )</a></emu-xref>
          or <emu-xref href="#sec-regexp.prototype-%symbol.match%" title=""><a href="https://tc39.es/ecma262/#sec-regexp.prototype-%symbol.match%">RegExp.prototype [ %Symbol.match% ] ( <var>string</var> )</a></emu-xref>
          depends on if the <var>regexp</var> has the <emu-val>g</emu-val> flag.
        </div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          When matching with a RegExp that <emu-val>"flags"</emu-val> contains <emu-val>"g"</emu-val>,
          both <emu-xref href="#sec-%regexpstringiteratorprototype%.next" title=""><a href="https://tc39.es/ecma262/#sec-%regexpstringiteratorprototype%.next">%RegExpStringIteratorPrototype%.next ( )</a></emu-xref>
          and <emu-xref href="#sec-%arrayiteratorprototype%.next" title=""><a href="https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next">%ArrayIteratorPrototype%.next ( )</a></emu-xref>
          are called, this is not ideal.
        </div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-indexed-collections" number="23">
  <h1><span class="secnum">23</span> Indexed Collections</h1>

  <emu-clause id="sec-array-objects" number="1">
    <h1><span class="secnum">23.1</span> Array Objects</h1>

    <emu-clause id="sec-properties-of-the-array-constructor" number="2">
      <h1><span class="secnum">23.1.2</span> Properties of the Array Constructor</h1>

      <emu-clause id="sec-array-%symbol.custommatcher%" number="6">
        <h1><span class="secnum">23.1.2.6</span> Array [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_57"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If ?&nbsp;<emu-xref aoid="IsArray"><a href="https://tc39.es/ecma262/#sec-isarray">IsArray</a></emu-xref>(<var>subject</var>) is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <var>subject</var>.</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is <span class="hljs-title class_">Array</span>(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>)) {}</code></pre></div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-typedarray-objects" number="2">
    <h1><span class="secnum">23.2</span> TypedArray Objects</h1>

    <emu-clause id="sec-properties-of-the-typedarray-constructors" number="6">
      <h1><span class="secnum">23.2.6</span> Properties of the <var>TypedArray</var> Constructors</h1>

      <emu-clause id="sec-_typedarray_-%symbol.custommatcher%" number="3">
        <h1><span class="secnum">23.2.6.3</span> <var>TypedArray</var> [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_58"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> does not have a <var class="field">[[TypedArrayName]]</var> internal slot or <var>subject</var>.<var class="field">[[TypedArrayName]]</var> is not <var>TypedArray</var>, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <var>subject</var>.</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">const</span> isPNG = binary is <span class="hljs-title class_">Uint</span>8<span class="hljs-built_in">Array</span>(
  <span class="hljs-number">0x89</span>, <span class="hljs-number">0x50</span>, <span class="hljs-number">0x4E</span>, <span class="hljs-number">0x47</span>,
  <span class="hljs-number">0x0D</span>, <span class="hljs-number">0x0A</span>, <span class="hljs-number">0x1A</span>, <span class="hljs-number">0x0A</span>, ...
); <span class="hljs-comment">// the ... is necessary otherwise it will only match a length-8 binary.</span></code></pre></div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-keyed-collections" number="24">
  <h1><span class="secnum">24</span> Keyed Collections</h1>

  <emu-clause id="sec-map-objects" number="1">
    <h1><span class="secnum">24.1</span> Map Objects</h1>

    <emu-clause id="sec-properties-of-the-map-constructor" number="2">
      <h1><span class="secnum">24.1.2</span> Properties of the Map Constructor</h1>

      <emu-clause id="sec-map-%symbol.custommatcher%" number="3">
        <h1><span class="secnum">24.1.2.3</span> Map [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_59"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> does not have a <var class="field">[[MapData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs">expr is <span class="hljs-title class_">Map</span>([[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>], [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>]]);
<span class="hljs-comment">// matches new Map([[1, 2], [3, 4]])</span>
<span class="hljs-comment">// but not new Map([[3, 4], [1, 2]])</span></code></pre></div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          A Map can be iterated, but is it meaningful to do so in pattern matching?
        </div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-set-objects" number="2">
    <h1><span class="secnum">24.2</span> Set Objects</h1>

    <emu-clause id="sec-properties-of-the-set-constructor" number="2">
      <h1><span class="secnum">24.2.2</span> Properties of the Set Constructor</h1>

      <emu-clause id="sec-set-%symbol.custommatcher%" number="3">
        <h1><span class="secnum">24.2.2.3</span> Set [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_60"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> does not have a <var class="field">[[SetData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>subject</var>&nbsp;»).</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs">expr is <span class="hljs-title class_">Set</span>([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>]);
<span class="hljs-comment">// matches new Set([1, 2, 3])</span>
<span class="hljs-comment">// but not new Set([3, 2, 1])</span></code></pre></div></emu-note>
        <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
          A Set can be iterated, but is it meaningful to do so in pattern matching?
        </div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-weakmap-objects" number="3">
    <h1><span class="secnum">24.3</span> WeakMap Objects</h1>

    <emu-clause id="sec-properties-of-the-weakmap-constructor" number="2">
      <h1><span class="secnum">24.3.2</span> Properties of the WeakMap Constructor</h1>

      <emu-clause id="sec-weakmap-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">24.3.2.2</span> WeakMap [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_61"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[WeakMapData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-weakset-objects" number="4">
    <h1><span class="secnum">24.4</span> WeakSet Objects</h1>

    <emu-clause id="sec-properties-of-the-weakset-constructor" number="2">
      <h1><span class="secnum">24.4.2</span> Properties of the WeakSet Constructor</h1>

      <emu-clause id="sec-weakset-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">24.4.2.2</span> WeakSet [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_62"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[WeakSetData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-structured-data" number="25">
  <h1><span class="secnum">25</span> Structured Data</h1>

  <emu-clause id="sec-arraybuffer-objects" number="1">
    <h1><span class="secnum">25.1</span> ArrayBuffer Objects</h1>

    <emu-clause id="sec-properties-of-the-arraybuffer-constructor" number="5">
      <h1><span class="secnum">25.1.5</span> Properties of the ArrayBuffer Constructor</h1>

      <emu-clause id="sec-arraybuffer-%symbol.custommatcher%" number="4">
        <h1><span class="secnum">25.1.5.4</span> ArrayBuffer [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_63"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> has a <var class="field">[[ArrayBufferData]]</var> internal slot, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-sharedarraybuffer-objects" number="2">
    <h1><span class="secnum">25.2</span> SharedArrayBuffer Objects</h1>

    <emu-clause id="sec-properties-of-the-sharedarraybuffer-constructor" number="4">
      <h1><span class="secnum">25.2.4</span> Properties of the SharedArrayBuffer Constructor</h1>

      <emu-clause id="sec-sharedarraybuffer-%symbol.custommatcher%" number="3">
        <h1><span class="secnum">25.2.4.3</span> SharedArrayBuffer [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_64"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[ArrayBufferData]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-xref aoid="IsSharedArrayBuffer"><a href="https://tc39.es/ecma262/#sec-issharedarraybuffer">IsSharedArrayBuffer</a></emu-xref>(<var>subject</var>).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-dataview-objects" number="3">
    <h1><span class="secnum">25.3</span> DataView Objects</h1>

    <emu-clause id="sec-properties-of-the-dataview-constructor" number="3">
      <h1><span class="secnum">25.3.3</span> Properties of the DataView Constructor</h1>

      <emu-clause id="sec-dataview-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">25.3.3.2</span> DataView [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_65"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[DataView]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-managing-memory" number="26">
  <h1><span class="secnum">26</span> Managing Memory</h1>

  <emu-clause id="sec-weak-ref-objects" number="1">
    <h1><span class="secnum">26.1</span> WeakRef Objects</h1>

    <emu-clause id="sec-properties-of-the-weak-ref-constructor" number="2">
      <h1><span class="secnum">26.1.2</span> Properties of the WeakRef Constructor</h1>

      <emu-clause id="sec-weakref-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">26.1.2.2</span> WeakRef [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_66"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>).</li><li>If <var>subject</var> does not have a <var class="field">[[WeakRefTarget]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <emu-xref aoid="WeakRefDeref"><a href="https://tc39.es/ecma262/#sec-weakrefderef">WeakRefDeref</a></emu-xref>(<var>subject</var>)&nbsp;»).</li></ol></emu-alg>
        <emu-note code=""><span class="note">Note</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is <span class="hljs-title class_">WeakRef</span>(<span class="hljs-keyword">let</span> object)) {}</code></pre></div></emu-note>
      </emu-clause>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-finalization-registry-objects" number="2">
    <h1><span class="secnum">26.2</span> FinalizationRegistry Objects</h1>

    <emu-clause id="sec-properties-of-the-finalization-registry-constructor" number="2">
      <h1><span class="secnum">26.2.2</span> Properties of the FinalizationRegistry Constructor</h1>

      <emu-clause id="sec-finalizationregistry-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">26.2.2.2</span> FinalizationRegistry [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_67"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>If <var>subject</var> does not have a <var class="field">[[CleanupCallback]]</var> internal slot, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-control-abstraction-objects" number="27">
  <h1><span class="secnum">27</span> Control Abstraction Objects</h1>

  <emu-clause id="sec-promise-objects" number="2">
    <h1><span class="secnum">27.2</span> Promise Objects</h1>

    <emu-clause id="sec-properties-of-the-promise-constructor" number="4">
      <h1><span class="secnum">27.2.4</span> Properties of the Promise Constructor</h1>

      <emu-clause id="sec-promise-%symbol.custommatcher%" number="9">
        <h1><span class="secnum">27.2.4.9</span> Promise [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="ValidateCustomMatcherHint" id="_ref_68"><a href="#sec-validatecustommatcherhint">ValidateCustomMatcherHint</a></emu-xref>(<var>hint</var>, <emu-const>boolean</emu-const>).</li><li>Return <emu-xref aoid="IsPromise"><a href="https://tc39.es/ecma262/#sec-ispromise">IsPromise</a></emu-xref>(<var>subject</var>).</li></ol></emu-alg>
      </emu-clause>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause class="fold" id="sec-reflection" number="28">
  <h1><span class="secnum">28</span> Reflection</h1>

  <emu-clause id="sec-proxy-objects" number="2">
    <h1><span class="secnum">28.2</span> Proxy Objects</h1>

    <emu-clause id="sec-proxy-constructor" number="1">
      <h1><span class="secnum">28.2.1</span> The Proxy Constructor</h1>

      <emu-clause id="sec-proxy-%symbol.custommatcher%" number="2">
        <h1><span class="secnum">28.2.1.2</span> Proxy [ %Symbol.customMatcher% ] ( )</h1>
        <p>This function performs the following steps when called:</p>
        <emu-alg><ol><li>Throw a <emu-val>TypeError</emu-val> exception.</li></ol></emu-alg>
      </emu-clause>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        <p>All built-in <emu-xref href="#constructor"><a href="https://tc39.es/ecma262/#constructor">constructors</a></emu-xref> have a <emu-xref href="#sec-well-known-symbols" id="_ref_69"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref> method. This one is for design consistency.</p>
        <p>This is not a consensus in the champion group.</p>
      </div></emu-note>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-clause id="sec-pattern-matching" number="30">
  <h1><span class="secnum">30</span> <ins>Pattern Matching</ins></h1>

  <emu-clause id="sec-match-patterns">
    <h1><span class="secnum">30.1</span> Match Patterns</h1>
    <h2>Syntax</h2>
    <emu-grammar type="definition"><emu-production name="MatchPattern" params="Yield, Await" id="prod-MatchPattern">
    <emu-nt params="Yield, Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iwqh9pom" id="prod-KUcUUgsn">
        <emu-t>(</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_221"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
    <emu-rhs a="sgh9k7d8" id="prod-NnfvhTBM">
        <emu-nt id="_ref_222"><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="vrxdrcn-" id="prod--5M7srSm">
        <emu-nt params="?Yield, ?Await" id="_ref_223"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="y46cfqhm" id="prod-dtu4srcz">
        <emu-nt params="?Yield, ?Await" id="_ref_224"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="hgfidvsy" id="prod-ZdrTiyJE">
        <emu-nt params="?Yield, ?Await" id="_ref_225"><a href="#prod-ObjectPattern">ObjectPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="x-p6r7m6" id="prod-l2SLZUMT">
        <emu-nt params="?Yield, ?Await" id="_ref_226"><a href="#prod-ArrayPattern">ArrayPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="6m-vwede" id="prod-en0pW04U">
        <emu-nt params="?Yield, ?Await" id="_ref_227"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="od8b4me6" id="prod-LetWbF4Q">
        <emu-nt params="?Yield, ?Await" id="_ref_228"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="4brcj28h" id="prod-GC1hibKU">
        <emu-nt params="?Yield, ?Await" id="_ref_229"><a href="#prod-IfPattern">IfPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="_7vcs4wd" id="prod-LAj8DpMp">
        <emu-nt params="?Yield, ?Await" id="_ref_230"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <emu-grammar><emu-production name="MatchPattern">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="llgnlz3m">
        <emu-t>void</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <p>
        This production will be added by <a target="_blank" href="https://github.com/tc39/proposal-discard-binding" data-print-href="">discard bindings proposal</a>.
      </p>
      <p>
        Some of the committe members prefer <code>_</code> as the discard binding identifier.
      </p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is [<span class="hljs-keyword">let</span> x, <span class="hljs-keyword">void</span>, <span class="hljs-keyword">void</span>]) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">if</span> (expr is [<span class="hljs-keyword">let</span> x,,,]) {}
<span class="hljs-comment">// or</span>
<span class="hljs-keyword">if</span> (expr is [<span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> _y, <span class="hljs-keyword">let</span> _z,]) {}</code></pre>
    </div></emu-note>
    <!-- #region PrimitivePattern -->
    <emu-grammar type="definition"><emu-production name="PrimitivePattern" id="prod-PrimitivePattern">
    <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kul-a19e" id="prod-lZG2aTTb">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="e_otk8es" id="prod-rqU7_eLx">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 1</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (value is <span class="hljs-literal">null</span>) {};
<span class="hljs-keyword">if</span> (value is <span class="hljs-literal">true</span>) {};
<span class="hljs-keyword">if</span> (value is <span class="hljs-number">1_000_000</span>) {};
<span class="hljs-keyword">if</span> (value is <span class="hljs-string">"string"</span>) {};
<span class="hljs-keyword">if</span> (value is <span class="hljs-string">`line 1
line 2`</span>) {};</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>
        Preserve the interpolation syntax for
        (1) <a target="_blank" href="https://github.com/tc39/proposal-pattern-matching/pull/293#discussion_r1350757767" data-print-href="">concerns about arbitrary expression interpolation</a> and
        (2) <a target="_blank" href="https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html#inference-with-template-literals" data-print-href="">intuitive string matching</a>.
      </p>
      <p>For example, match <code>"com.example:method()"</code> by</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (qualifiedName is <span class="hljs-string">`<span class="hljs-subst">${isPackageName and <span class="hljs-keyword">let</span> pkg}</span>:<span class="hljs-subst">${isIdentifier and <span class="hljs-keyword">let</span> method}</span>()`</span>) {}</code></pre>
    </div></emu-note>
    <!-- endregion -->
    <!-- #region VariableDeclarationPattern -->
    <emu-grammar type="definition"><emu-production name="VariableDeclarationPattern" params="Yield, Await" id="prod-VariableDeclarationPattern">
    <emu-nt params="Yield, Await"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="97sngitm" id="prod-u_-PVDpb">
        <emu-nt id="_ref_231"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="VarOrLetOrConst" id="prod-VarOrLetOrConst">
    <emu-nt><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="5hawgwsl">
        <emu-t>var</emu-t>
    </emu-rhs>
    <emu-rhs a="0oi0tt1n">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-LetOrConst">LetOrConst</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 2</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">kind</span>: <span class="hljs-keyword">let</span> kind }) {}
<span class="hljs-keyword">return</span> match (expr) {
  [<span class="hljs-keyword">let</span> left, <span class="hljs-keyword">let</span> op, <span class="hljs-keyword">let</span> right]: evaluate(op, left, right);
};</code></pre></div></emu-note>
    <!-- endregion -->
    <!-- #region MemberExpressionPattern -->
    <emu-grammar type="definition"><emu-production name="MemberExpressionPattern" params="Yield, Await" id="prod-MemberExpressionPattern">
    <emu-nt params="Yield, Await"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uxdrsrnt" id="prod-G4gXeSPg">
        <emu-nt params="?Yield, ?Await" id="_ref_232"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="k5qxkpt8" id="prod-QmuUz1ZR">
        <emu-nt params="?Yield, ?Await" id="_ref_233"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>(</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_234"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="PatternMatchingMemberExpression" params="Yield, Await" id="prod-PatternMatchingMemberExpression">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jo4mwtvh">
        <emu-t>this</emu-t>
    </emu-rhs>
    <emu-rhs a="yb7id2be">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-MetaProperty">MetaProperty</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="dlsgch-w">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-IdentifierReference">IdentifierReference</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="9pdsslwb">
        <emu-t>super</emu-t>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="kupcnmlh">
        <emu-nt params="?Yield, ?Await" id="_ref_235"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="ks20qjkp">
        <emu-nt params="?Yield, ?Await" id="_ref_236"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="qvqrwddh">
        <emu-nt params="?Yield, ?Await" id="_ref_237"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>[</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 3</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-literal">undefined</span>, <span class="hljs-attr">y</span>: <span class="hljs-literal">undefined</span> }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">angle</span>: <span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span>, <span class="hljs-keyword">let</span> length }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">ok</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">value</span>: <span class="hljs-variable language_">this</span>.#lastValue }) {}
<span class="hljs-keyword">if</span> (expr === <span class="hljs-keyword">import</span>.<span class="hljs-property">meta</span>?.<span class="hljs-property">hot</span>?.<span class="hljs-property">data</span> &amp;&amp; expr is { <span class="hljs-keyword">let</span> previousData }) {}
<span class="hljs-keyword">if</span> (expr is <span class="hljs-title class_">WeakRef</span>(<span class="hljs-keyword">let</span> object)) {}</code></pre></div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      This is the minimal requirement.
      All other productions can be removed.
      <emu-grammar><emu-production name="PatternMatchingMemberExpression">
    <emu-nt><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="i2hxnrih">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierReference">IdentifierReference</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="uuzihwmo">
        <emu-nt id="_ref_238"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (value is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">data</span>: <span class="hljs-variable language_">this</span>.#data }) {};
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">const</span> data = <span class="hljs-variable language_">this</span>.#data;
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">data</span>: data }) {}</code></pre>
      <p>
        It is similar to the <a href="https://tc39.es/proposal-decorators/#sec-new-syntax" target="_blank" data-print-href="">DecoratorMemberExpression</a>.
      </p>
      <p>Should we allow <code>MemberExpressionPattern[expr]</code> to match with computed property names?</p>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      It is possible to add the following productions:
      <emu-grammar><emu-production name="PatternMatchingMemberExpression">
    <emu-nt><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e9h5acuc">
        <emu-nt id="_ref_239"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
        <emu-t>?.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="tm21cow6">
        <emu-nt id="_ref_240"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
        <emu-t>?.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <p>It does not clear if this should match <emu-val>undefined</emu-val> or fail the match if the <emu-nt id="_ref_241"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt> is <emu-val>undefined</emu-val>.</p>
    </div></emu-note>
    <!-- endregion -->
    <!-- #region ObjectPattern and ArrayPattern -->
    <emu-grammar type="definition"><emu-production name="ObjectPattern" params="Yield, Await" id="prod-ObjectPattern">
    <emu-nt params="Yield, Await"><a href="#prod-ObjectPattern">ObjectPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-nriCsL_r">
        <emu-t>{</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="rqbh5emu" id="prod-EWVgVnxN">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_242"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="criubbam" id="prod-UnQjidH-">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_243"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">,<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="9huzo627" id="prod-xpU3Tqeh">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_244"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_245"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="ArrayPattern" params="Yield, Await" id="prod-ArrayPattern">
    <emu-nt params="Yield, Await"><a href="#prod-ArrayPattern">ArrayPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hiem5cht" id="prod-mfwF-eVh">
        <emu-t>[</emu-t>
        <emu-nt params="?Yield, ?Await" optional="" id="_ref_246"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="MatchList" params="Yield, Await" id="prod-MatchList">
    <emu-nt params="Yield, Await"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ctjw6vnw" id="prod-xnwBdNr0">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await" optional="" id="_ref_247"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="q59bwnvc" id="prod-5aJhmP6v">
        <emu-nt params="?Yield, ?Await" id="_ref_248"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="f1xo1a3j" id="prod-Qinb_JH_">
        <emu-nt params="?Yield, ?Await" id="_ref_249"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await" optional="" id="_ref_250"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchRestProperty" params="Yield, Await" id="prod-MatchRestProperty">
    <emu-nt params="Yield, Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rfqjkmvm" id="prod-NpqrpNeK">
        <emu-t>...</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_251"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchPropertyList" params="Yield, Await" id="prod-MatchPropertyList">
    <emu-nt params="Yield, Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3j9bvwgo" id="prod-kRoJE3bP">
        <emu-nt params="?Yield, ?Await" id="_ref_252"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="jbgwhfq0" id="prod-_cQam8pS">
        <emu-nt params="?Yield, ?Await" id="_ref_253"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_254"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchElementList" params="Yield, Await" id="prod-MatchElementList">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mftbrreq" id="prod-gb-onOzg">
        <emu-nt params="?Yield, ?Await" id="_ref_255"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="ubrozurn" id="prod--q9atpfX">
        <emu-nt params="?Yield, ?Await" id="_ref_256"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_257"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchElisionElement" params="Yield, Await" id="prod-MatchElisionElement">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vcapw5oy" id="prod-SwXPxa2u">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await" id="_ref_258"><a href="#prod-MatchElement">MatchElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchProperty" params="Yield, Await" id="prod-MatchProperty">
    <emu-nt params="Yield, Await"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4z7kdpah" id="prod-VxHnNNub">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="jy5wa0t2" id="prod-GMqEmzsz">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_259"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="17gzu0ni" id="prod-GO0bgB3_">
        <emu-nt id="_ref_260"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="w_78smtm" id="prod-xrsY-24G">
        <emu-nt id="_ref_261"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_262"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchElement" params="Yield, Await" id="prod-MatchElement">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElement">MatchElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="umiqybes" id="prod-lKjcdi_o">
        <emu-nt params="?Yield, ?Await" id="_ref_263"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="MatchRestElement" params="Yield, Await" id="prod-MatchRestElement">
    <emu-nt params="Yield, Await"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uugqq7gf" id="prod-fOlW2Nsd">
        <emu-t>...</emu-t>
    </emu-rhs>
    <emu-rhs a="rfqjkmvm" id="prod-w_IWHbxt">
        <emu-t>...</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_264"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 4</span><div class="note-contents">
      <p>Object matchers</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">type</span>: <span class="hljs-title class_">String</span>, value?: <span class="hljs-keyword">void</span> }) {}
<span class="hljs-comment">// test if subject[Symbol.iterator] is present.</span>
<span class="hljs-keyword">if</span> (expr is { [<span class="hljs-title class_">Symbol</span>.<span class="hljs-property">iterator</span>]?: <span class="hljs-title class_">Function</span> }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-number">0</span>: <span class="hljs-title class_">String</span> }) {}</code></pre>
      <p>Array matchers</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is [<span class="hljs-string">"request"</span>, <span class="hljs-keyword">let</span> method, ...<span class="hljs-keyword">let</span> params]) {}
<span class="hljs-comment">// match an iterable that first 2 values match a and b and no more values.</span>
<span class="hljs-keyword">if</span> (expr is [a, b]) {}
<span class="hljs-comment">// match an iterable that first 2 values match a and b.</span>
<span class="hljs-keyword">if</span> (expr is [a, b, ...]) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      It is possible to add <emu-nt><a href="https://tc39.es/ecma262/#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt> to <emu-nt id="_ref_265"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt>.
      <pre><code class="javascript hljs"><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyClass</span> {
  #field;
  <span class="hljs-title function_">test</span>(<span class="hljs-params">data</span>) {
    <span class="hljs-keyword">if</span> (data is { <span class="hljs-attr">value</span>: { #<span class="hljs-attr">field</span>: <span class="hljs-keyword">let</span> field } }) {}
    <span class="hljs-comment">// can be written as</span>
    <span class="hljs-keyword">if</span> (data is { <span class="hljs-keyword">let</span> <span class="hljs-attr">value</span>: <span class="hljs-title class_">MyClass</span> }) {
      <span class="hljs-keyword">let</span> field = value.#field;
    }
  }
}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      It is possible to add <emu-nt><a href="https://tc39.es/ecma262/#prod-Initializer">Initializer</a></emu-nt> to <emu-nt id="_ref_266"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> and <emu-nt id="_ref_267"><a href="#prod-MatchElement">MatchElement</a></emu-nt>.
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">type</span>: <span class="hljs-string">"report"</span>, <span class="hljs-keyword">let</span> key }) { <span class="hljs-title function_">reportKey</span>(key); }
<span class="hljs-keyword">else</span> { <span class="hljs-title function_">reportKey</span>(<span class="hljs-title class_">Symbol</span>.<span class="hljs-title function_">for</span>(<span class="hljs-string">"missing"</span>)) };
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">type</span>: <span class="hljs-string">"report"</span>, <span class="hljs-keyword">let</span> key = <span class="hljs-title class_">Symbol</span>.<span class="hljs-title function_">for</span>(<span class="hljs-string">"missing"</span>) }) { <span class="hljs-title function_">reportKey</span>(key); }</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>The <code>?</code> in the production <emu-nt id="_ref_268"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> or <emu-nt id="_ref_269"><a href="#prod-MatchElement">MatchElement</a></emu-nt> can be removed.</p>
      <p>The feature is not a consensus in the champion group yet.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y? }) {}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> x }) {}
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y }) {}

<span class="hljs-keyword">if</span> (expr is [x, y?]) {}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">if</span> (expr is [x]) {}
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (expr is [x, y]) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <emu-grammar><emu-production name="MatchProperty">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f0mgqa9f">
        <emu-nt id="_ref_270"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt id="_ref_271"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="gzjg2iry">
        <emu-nt id="_ref_272"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <p>These productions can be removed.</p>
      <p>This feature is not a consensus in the champion group yet.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span>, <span class="hljs-keyword">let</span> <span class="hljs-attr">y</span>: <span class="hljs-title class_">String</span> }) {}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">y</span>: <span class="hljs-title class_">String</span> and <span class="hljs-keyword">let</span> y }) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <emu-grammar><emu-production name="MatchProperty" collapsed="">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8fjnez1">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <p>Computed properties can be removed from this production, but it will be harder to match computed properties.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> length, [<span class="hljs-title class_">Symbol</span>.<span class="hljs-property">iterator</span>]: <span class="hljs-title class_">Function</span> }) {}
<span class="hljs-comment">// can be written as</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">isIterable</span>(<span class="hljs-params">value</span>) { <span class="hljs-keyword">return</span> <span class="hljs-keyword">typeof</span> value[<span class="hljs-title class_">Symbol</span>.<span class="hljs-property">iterator</span>] === <span class="hljs-string">"function"</span>; }
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> length } and isIterable) {}</code></pre>
    </div></emu-note>
    <!-- endregion -->
    <!-- #region UnaryAlgebraicPattern -->
    <emu-grammar type="definition"><emu-production name="UnaryAlgebraicPattern" params="Yield, Await" id="prod-UnaryAlgebraicPattern">
    <emu-nt params="Yield, Await"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tmtbe2kk" id="prod-blOttJBG">
        <emu-nt params="?Yield, ?Await" id="_ref_273"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="PatternMatchingUnaryAlgebraicExpression" params="Yield, Await" id="prod-PatternMatchingUnaryAlgebraicExpression">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qi2orlde">
        <emu-t>+</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_274"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vdzozs8g">
        <emu-t>-</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_275"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="1epwai_f">
        <emu-t>+</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="u8w2p_fz">
        <emu-t>-</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 5</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is -<span class="hljs-number">0</span>) {} <span class="hljs-comment">// not matching `+0` and vice versa</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: -<span class="hljs-title class_">Infinity</span>, <span class="hljs-attr">y</span>: -<span class="hljs-title class_">Infinity</span> }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">angle</span>: -<span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span>, <span class="hljs-keyword">let</span> length }) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>Only literal <code>+0</code> or <code>-0</code> will be matched with <emu-xref aoid="SameValue"><a href="https://tc39.es/ecma262/#sec-samevalue">SameValue</a></emu-xref>, <code>+</code><var>x</var> and <code>-</code><var>x</var> where <var>x</var> is 0 will be matched with <emu-xref aoid="SameValueZero"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>.</p>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      This feature can be removed, but it will be harder to handle with <code>+0</code> and <code>-0</code>.
      The code example above can be written as:
      <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> negPi = -<span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span>;
<span class="hljs-keyword">if</span> (<span class="hljs-title class_">Object</span>.<span class="hljs-title function_">is</span>(expr, -<span class="hljs-number">0</span>)) {} <span class="hljs-comment">// not matching `+0` and vice versa</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-title class_">Number</span>.<span class="hljs-property">NEGATIVE_INFINITY</span>, <span class="hljs-attr">y</span>: <span class="hljs-title class_">Number</span>.<span class="hljs-property">NEGATIVE_INFINITY</span> }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">angle</span>: negPi, <span class="hljs-keyword">let</span> length }) {}</code></pre>
    </div></emu-note>
    <!-- endregion -->
    <!-- #region RelationalPattern -->
    <emu-grammar type="definition"><emu-production name="RelationalPattern" params="Yield, Await" id="prod-RelationalPattern">
    <emu-nt params="Yield, Await"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ueb64z-p" id="prod-Ee4jkDah">
        <emu-t>&lt;</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_276"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="_g7ioekk" id="prod-Lt1ufiOJ">
        <emu-t>&gt;</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_277"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="rl3zkfvt" id="prod-MbwVHJm5">
        <emu-t>&lt;=</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_278"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="h7t5jy7j" id="prod-LIsJEGG_">
        <emu-t>&gt;=</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_279"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="2x6y5fx8" id="prod-sQz7HIlw">
        <emu-t>instanceof</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_280"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="seylmk0k" id="prod-wD-UQ48A">
        <emu-t>in</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_281"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="gquawcje" id="prod-LdC39dQb">
        <emu-t>==</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_282"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="blybrpqt" id="prod-WzM35PsW">
        <emu-t>!=</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_283"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="ui_gas75" id="prod-ofL39yLB">
        <emu-t>===</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_284"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vehxltqc" id="prod-atFGrhH0">
        <emu-t>!==</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_285"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="PatternMatchingRelationalExpression" params="Yield, Await" id="prod-PatternMatchingRelationalExpression">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kul-a19e">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="e_otk8es">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="uxdrsrnt">
        <emu-nt params="?Yield, ?Await" id="_ref_286"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="tmtbe2kk">
        <emu-nt params="?Yield, ?Await" id="_ref_287"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 6</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is &gt; -<span class="hljs-number">10</span> and &lt; <span class="hljs-number">10</span>) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">value</span>: <span class="hljs-keyword">instanceof</span> <span class="hljs-title class_">Error</span> and { <span class="hljs-keyword">let</span> message } }) {}
<span class="hljs-keyword">if</span> (expr is [=== <span class="hljs-title class_">Array</span>, === <span class="hljs-title class_">Object</span>]) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>It is possible to add the following production.</p>
      <emu-grammar><emu-production name="RelationalPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="lmjceozr">
        <emu-t>typeof</emu-t>
        <emu-t>==</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_288"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="pbt7d9qs">
        <emu-t>typeof</emu-t>
        <emu-t>!=</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_289"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="ubo1dvvr">
        <emu-t>typeof</emu-t>
        <emu-t>===</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_290"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="djqh0ggm">
        <emu-t>typeof</emu-t>
        <emu-t>!==</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_291"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-grammar type="definition"><emu-production name="PatternMatchingStringLikeExpression" params="Yield, Await" id="prod-PatternMatchingStringLikeExpression">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xhtltz00">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-StringLiteral">StringLiteral</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="e_otk8es">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="uxdrsrnt">
        <emu-nt params="?Yield, ?Await" id="_ref_292"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <p>
        The recommended way to match a String is to use the <emu-xref href="#sec-string-%symbol.custommatcher%" title="" id="_ref_16"><a href="#sec-string-%symbol.custommatcher%">String [ %Symbol.customMatcher% ] ( <var>subject</var>, <var>hint</var> )</a></emu-xref>,
        but it can be replaced by a custom implementation. This production adds the ability to do the unforgeable <code>typeof</code> test.
      </p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span> or <span class="hljs-number">3</span>, <span class="hljs-attr">value</span>: <span class="hljs-title class_">String</span> }) {}
<span class="hljs-comment">// can be written as this if built-ins might be replaced:</span>
<span class="hljs-keyword">const</span> isString = {
  [<span class="hljs-title class_">Symbol</span>.<span class="hljs-property">customMatcher</span>](val) {
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">typeof</span> val === <span class="hljs-string">"string"</span>;
  }
};
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span> or <span class="hljs-number">3</span>, <span class="hljs-attr">value</span>: isString }) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>It is possible to add the following production.</p>
      <emu-grammar><emu-production name="RelationalPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rbeiqqqq">
        <emu-t>has</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_293"><a href="#prod-PatternMatchingStringLikeExpression">PatternMatchingStringLikeExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="fn0heehf">
        <emu-t>has</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <pre><code class="javascript hljs"><span class="hljs-keyword">function</span> <span class="hljs-title function_">hasPrivateField</span>(<span class="hljs-params">val</span>) { <span class="hljs-keyword">return</span> #field <span class="hljs-keyword">in</span> val; }
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span> or <span class="hljs-number">3</span>, <span class="hljs-attr">data</span>: hasPrivateField }) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span> or <span class="hljs-number">3</span>, <span class="hljs-attr">data</span>: has #field }) {}</code></pre>
      <p>This feature can be a proposal on its own, to be the <code>in</code> operator reversed.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr has #field) { }
<span class="hljs-keyword">if</span> (expr hasOwn <span class="hljs-string">"prototype"</span>) { }</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>The <code>instanceof</code> production can be removed, but it will be harder to match by <code>instanceof</code> semantics.</p>
      <p>This feature is not a consensus in the champion group.</p>
      <p>
        The class matchers match by private-field semantics,
        the <code>instanceof</code> match is an escape hatch to match with the <code>instanceof</code> semantics.
      </p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">elements</span>: [<span class="hljs-keyword">instanceof</span> <span class="hljs-title class_">Map</span>, <span class="hljs-keyword">instanceof</span> <span class="hljs-title class_">Map</span>] }) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">isInstanceOfMap</span>(<span class="hljs-params">val</span>) { <span class="hljs-keyword">return</span> val <span class="hljs-keyword">instanceof</span> <span class="hljs-title class_">Map</span>; }
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">elements</span>: [isInstanceOfMap, isInstanceOfMap] }) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>
        The <code>==</code>, <code>!=</code>, <code>===</code>, and <code>!==</code> production can be removed,
        but it will be harder to match by <code>===</code> semantics when the <emu-nt id="_ref_294"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt> is a custom matcher.
      </p>
      <p>This feature is not a consensus in the champion group.</p>
      <pre class="inline"><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">type</span>: <span class="hljs-string">"create"</span>, <span class="hljs-attr">initializers</span>: [createX] }) {}</code></pre>
      <p>
        The code above will try to call <var>createX</var> as a custom matcher.
        This feature is an opt-out of the custom matcher, to always do the <code>===</code> check.
      </p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">type</span>: <span class="hljs-string">"create"</span>, <span class="hljs-attr">initializers</span>: [=== createX] }) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">isCreateX</span>(<span class="hljs-params">val</span>) { <span class="hljs-keyword">return</span> val === createX; }
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">type</span>: <span class="hljs-string">"create"</span>, <span class="hljs-attr">initializers</span>: [isCreateX] }) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>The <code>in</code> production can be removed, but it will be harder to match by <code>in</code> semantics.</p>
      <p>This feature is not a consensus in the champion group.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> <span class="hljs-attr">key</span>: <span class="hljs-keyword">in</span> object } and inCache) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">isInObj</span>(<span class="hljs-params">key</span>) { <span class="hljs-keyword">return</span> key <span class="hljs-keyword">in</span> object; }
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> <span class="hljs-attr">key</span>: isInObj } and inCache) {}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>The <code>&gt;</code>, <code>&lt;</code>, <code>&gt;=</code> and <code>&lt;=</code> production can be removed, but it will be harder to match numbers.</p>
      <p>This feature is not a consensus in the champion group.</p>
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is [&gt; -<span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span> and &lt; <span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span>, &gt; <span class="hljs-number">0</span>]) {}
<span class="hljs-comment">// can be written as:</span>
<span class="hljs-keyword">if</span> (expr[<span class="hljs-number">0</span>] &gt; -<span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span> &amp;&amp; expr[<span class="hljs-number">0</span>] &lt; <span class="hljs-title class_">Math</span>.<span class="hljs-property">PI</span> &amp;&amp; expr[<span class="hljs-number">1</span>] &gt; <span class="hljs-number">0</span>) {}</code></pre>
    </div></emu-note>
    <!-- endregion -->
    <!-- #region IfPattern -->
    <emu-grammar type="definition"><emu-production name="IfPattern" params="Yield, Await" id="prod-IfPattern">
    <emu-nt params="Yield, Await"><a href="#prod-IfPattern">IfPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sgbsfmyz" id="prod-F0nSIfMB">
        <emu-t>if</emu-t>
        <emu-t>(</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 7</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">return</span> match (expr) {
  { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y, <span class="hljs-keyword">let</span> z } and <span class="hljs-keyword">if</span> (<span class="hljs-title function_">norm</span>(x, y, z) &lt; maxLength): [x, y];
  { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y } and <span class="hljs-keyword">if</span> (<span class="hljs-title function_">norm</span>(x, y) &lt; maxLength): [x, y];
  <span class="hljs-title class_">Number</span> and &lt; maxLength <span class="hljs-keyword">let</span> <span class="hljs-attr">length</span>: [length];
}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      This feature can be removed, but this is designed as an escape hatch.
      No alternative is available for this feature.
    </div></emu-note>
    <!-- endregion -->
    <!-- #region CombinedMatchPattern -->
    <emu-grammar type="definition"><emu-production name="CombinedMatchPattern" params="Yield, Await" id="prod-CombinedMatchPattern">
    <emu-nt params="Yield, Await"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ao53rdyl" id="prod-a_2cW9fV">
        <emu-nt params="?Yield, ?Await" id="_ref_295"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>and</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_296"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="nhqoi23u" id="prod-BMX8uZDG">
        <emu-nt params="?Yield, ?Await" id="_ref_297"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>or</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_298"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="qryeevni" id="prod-4IhLPseH">
        <emu-t>not</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_299"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note 8</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-number">2</span> or <span class="hljs-number">3</span> }) {}
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">version</span>: <span class="hljs-title class_">Number</span> and not <span class="hljs-number">1</span> }) {}</code></pre>
    </div></emu-note>
    <!-- endregion -->

    <emu-clause id="sec-match-patterns-static-semantics-early-errors">
      <h1><span class="secnum">30.1.1</span> Static Semantics: Early Errors</h1>
      <!-- #region PrimitivePattern -->
      <emu-grammar><emu-production name="PrimitivePattern" collapsed="">
    <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e_otk8es"><emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.</li>
      </ul>
      <!-- #endregion -->
      <!-- #region VariableDeclarationPattern -->
      <emu-grammar><emu-production name="VariableDeclarationPattern" collapsed="">
    <emu-nt><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="p6fje17y">
        <emu-nt id="_ref_300"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-nt id="_ref_301"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt> is <emu-nt><a href="https://tc39.es/ecma262/#prod-LetOrConst">LetOrConst</a></emu-nt> and the <emu-xref aoid="StringValue"><a href="https://tc39.es/ecma262/#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is <emu-val>"let"</emu-val>.</li>
      </ul>
      <!-- #endregion -->
      <!-- #region ObjectPattern and ArrayPattern -->
      <emu-grammar><emu-production name="MatchProperty">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8fjnez1">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="9mxwi2yo">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt id="_ref_302"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt> is a <emu-nt><a href="https://tc39.es/ecma262/#prod-LiteralPropertyName">LiteralPropertyName</a></emu-nt> and <emu-xref aoid="PropName"><a href="https://tc39.es/ecma262/#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt> is <emu-val>"__proto__"</emu-val>.</li>
      </ul>
      <emu-note code=""><span class="note">Note 1</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">__proto__</span>: <span class="hljs-literal">null</span>, property?: <span class="hljs-keyword">void</span> }) {} <span class="hljs-comment">// Syntax Error</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-string">"__proto__"</span>: <span class="hljs-literal">null</span>, property?: <span class="hljs-keyword">void</span> }) {} <span class="hljs-comment">// Syntax Error</span>
<span class="hljs-keyword">if</span> (expr is { [<span class="hljs-string">"__proto__"</span>]: <span class="hljs-literal">null</span>, property?: <span class="hljs-keyword">void</span> }) {} <span class="hljs-comment">// no Syntax Error</span></code></pre></div></emu-note>
      <emu-grammar><emu-production name="MatchRestElement">
    <emu-nt><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_dw8adpi">
        <emu-t>...</emu-t>
        <emu-nt id="_ref_303"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchRestElement">
    <emu-nt><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_dw8adpi">
        <emu-t>...</emu-t>
        <emu-nt id="_ref_304"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-nt id="_ref_305"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> is <emu-nt id="_ref_306"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a></emu-nt>.</li>
        <li>This is not a consensus in the champion group.</li>
      </ul>
      <emu-note code=""><span class="note">Note 2</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-number">0</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">0</span>, ...rest }) {} <span class="hljs-comment">// Syntax Error</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-number">0</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">0</span>, ...<span class="hljs-keyword">let</span> rest }) {} <span class="hljs-comment">// no Syntax Error, bind rest properties to _rest_</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-number">0</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">0</span>, ...(isEmpty) }) {} <span class="hljs-comment">// no Syntax Error, call isEmpty with the rest object</span></code></pre></div></emu-note>
      <emu-grammar><emu-production name="MatchProperty">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4z7kdpah">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="jy5wa0t2">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_307"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt> can be <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li>
        <li>This is not a consensus in the champion group.</li>
      </ul>
      <emu-note code=""><span class="note">Note 3</span><div class="note-contents"><pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is { x, y, z }) {} <span class="hljs-comment">// Syntax Error</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-attr">x</span>: <span class="hljs-keyword">void</span>, <span class="hljs-attr">y</span>: <span class="hljs-keyword">void</span>, <span class="hljs-attr">z</span>: <span class="hljs-keyword">void</span> }) {} <span class="hljs-comment">// no Syntax Error</span>
<span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y, <span class="hljs-keyword">let</span> z }) {} <span class="hljs-comment">// no Syntax Error</span>

<span class="hljs-keyword">if</span> (expr is { <span class="hljs-keyword">if</span> }) {} <span class="hljs-comment">// no Syntax Error</span></code></pre></div></emu-note>
      <emu-grammar><emu-production name="MatchList">
    <emu-nt><a href="#prod-MatchList">MatchList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uah6njv4">
        <emu-nt id="_ref_308"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt optional="" id="_ref_309"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-xref aoid="IsOptionalPattern" id="_ref_70"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_310"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> is <emu-val>true</emu-val> and <emu-nt><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a></emu-nt> is present.</li>
      </ul>
      <emu-grammar><emu-production name="MatchElementList">
    <emu-nt><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="eheyxnr4">
        <emu-nt id="_ref_311"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt id="_ref_312"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if <emu-xref aoid="IsOptionalPattern" id="_ref_71"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_313"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsOptionalPattern" id="_ref_72"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_314"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt> is <emu-val>false</emu-val>.</li>
      </ul>
      <emu-note code=""><span class="note">Note 4</span><div class="note-contents"><pre><code class="javascript hljs">value is [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>?, <span class="hljs-number">3</span>]; <span class="hljs-comment">// Syntax Error</span>
value is [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>?, <span class="hljs-number">3</span>?]; <span class="hljs-comment">// no Syntax Error</span>

value is [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>?, , ]; <span class="hljs-comment">// Syntax Error (Elision)</span>
value is [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>?, <span class="hljs-keyword">void</span>?, ]; <span class="hljs-comment">// no Syntax Error</span>

value is [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>?, ...]; <span class="hljs-comment">// no Syntax Error</span></code></pre></div></emu-note>
      <!-- endregion -->
      <!-- #region CombinedMatchPattern -->
      <emu-grammar><emu-production name="CombinedMatchPattern">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4lmqei0y">
        <emu-nt id="_ref_315"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>and</emu-t>
        <emu-nt id="_ref_316"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if either of <emu-nt id="_ref_317"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>s is <emu-nt id="_ref_318"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> and does not match this production.</li>
      </ul>
      <emu-grammar><emu-production name="CombinedMatchPattern">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9wuvrand">
        <emu-nt id="_ref_319"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>or</emu-t>
        <emu-nt id="_ref_320"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if either of <emu-nt id="_ref_321"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>s is <emu-nt id="_ref_322"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> and does not match this production.</li>
      </ul>
      <emu-grammar><emu-production name="CombinedMatchPattern">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_ieabtbd">
        <emu-t>not</emu-t>
        <emu-nt id="_ref_323"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <ul>
        <li>It is a Syntax Error if the <emu-nt id="_ref_324"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> is <emu-nt id="_ref_325"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt>.</li>
      </ul>
      <emu-note code=""><span class="note">Note 5</span><div class="note-contents"><pre><code class="javascript hljs">value is a and b and c; <span class="hljs-comment">// no Syntax Error</span>
value is a or b or c; <span class="hljs-comment">// no Syntax Error</span>

value is a and b or c; <span class="hljs-comment">// Syntax Error</span>
value is (a and b) or c; <span class="hljs-comment">// no Syntax Error</span>
value is a and (b or c); <span class="hljs-comment">// no Syntax Error</span>

value is not not a; <span class="hljs-comment">// Syntax Error</span>
value is not (not a); <span class="hljs-comment">// no Syntax Error</span>

value is not a or b; <span class="hljs-comment">// Syntax Error</span>
value is not (a or b); <span class="hljs-comment">// no Syntax Error</span></code></pre></div></emu-note>
      <!-- endregion -->
    </emu-clause>

    <emu-clause id="sec-is-optional-pattern" type="sdo" aoid="IsOptionalPattern">
      <h1><span class="secnum">30.1.2</span> Static Semantics: IsOptionalPattern</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IsOptionalPattern takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchElementList" collapsed="">
    <emu-nt><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dlv9v-6j" id="prod-yCjtcQ2s"><emu-nt id="_ref_326"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="IsOptionalPattern" id="_ref_73"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_327"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElementList" collapsed="">
    <emu-nt><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="eheyxnr4" id="prod-uWaCy0rP">
        <emu-nt id="_ref_328"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt id="_ref_329"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <emu-xref aoid="IsOptionalPattern" id="_ref_74"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_330"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="IsOptionalPattern" id="_ref_75"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_331"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElisionElement" collapsed="">
    <emu-nt><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="c0r7zx1e" id="prod-NV8BPc1p">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt id="_ref_332"><a href="#prod-MatchElement">MatchElement</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <emu-nt><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a></emu-nt> is present, return <emu-val>false</emu-val>.</li><li>Return <emu-xref aoid="IsOptionalPattern" id="_ref_76"><a href="#sec-is-optional-pattern">IsOptionalPattern</a></emu-xref> of <emu-nt id="_ref_333"><a href="#prod-MatchElement">MatchElement</a></emu-nt>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElement" collapsed="">
    <emu-nt><a href="#prod-MatchElement">MatchElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qvuneavu" id="prod-Eavr6r2E">
        <emu-nt id="_ref_334"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <code>?</code> is present, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-match-pattern-matches" type="sdo" aoid="MatchPatternMatches">
      <h1><span class="secnum">30.1.3</span> Runtime Semantics: MatchPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> MatchPatternMatches takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_77"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="59hl_iep" id="prod-U80C8biY">
        <emu-t>(</emu-t>
        <emu-nt id="_ref_335"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_78"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_336"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sgh9k7d8" id="prod-6fPS70C2"><emu-nt id="_ref_337"><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="PrimitivePatternMatches" id="_ref_79"><a href="#sec-primitive-pattern-matches">PrimitivePatternMatches</a></emu-xref> of <emu-nt id="_ref_338"><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> with argument <var>subject</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="27xtpaqy" id="prod-8y3jNblH"><emu-nt id="_ref_339"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="VariableDeclarationPatternMatches" id="_ref_80"><a href="#sec-variable-declaration-pattern-matches">VariableDeclarationPatternMatches</a></emu-xref> of <emu-nt id="_ref_340"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a></emu-nt> with argument <var>subject</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="zftkm5nb" id="prod-vBMoWeeV"><emu-nt id="_ref_341"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="MemberExpressionPatternMatches" id="_ref_81"><a href="#sec-member-expression-pattern-matches" class="e-user-code">MemberExpressionPatternMatches</a></emu-xref> of <emu-nt id="_ref_342"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cyavtzzb" id="prod-mpb2HCVB"><emu-nt id="_ref_343"><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="ObjectPatternMatches" id="_ref_82"><a href="#sec-object-pattern-matches" class="e-user-code">ObjectPatternMatches</a></emu-xref> of <emu-nt id="_ref_344"><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dfbie73u" id="prod-QXRatsJR"><emu-nt id="_ref_345"><a href="#prod-ArrayPattern">ArrayPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="ArrayPatternMatches" id="_ref_83"><a href="#sec-array-pattern-matches" class="e-user-code">ArrayPatternMatches</a></emu-xref> of <emu-nt id="_ref_346"><a href="#prod-ArrayPattern">ArrayPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gq_1p9nv" id="prod-MW-Egi0C"><emu-nt id="_ref_347"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="UnaryAlgebraicPatternMatches" id="_ref_84"><a href="#sec-unary-algebraic-pattern-matches" class="e-user-code">UnaryAlgebraicPatternMatches</a></emu-xref> of <emu-nt id="_ref_348"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a></emu-nt> with argument <var>subject</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="h36b3hfy" id="prod-E8S1P1H4"><emu-nt id="_ref_349"><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="RelationalPatternMatches" id="_ref_85"><a href="#sec-relational-pattern-matches" class="e-user-code">RelationalPatternMatches</a></emu-xref> of <emu-nt id="_ref_350"><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> with arguments <var>subject</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="h3fpdsgw" id="prod-rvZDZ_Jw"><emu-nt id="_ref_351"><a href="#prod-IfPattern">IfPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="IfPatternMatches" id="_ref_86"><a href="#sec-if-pattern-matches" class="e-user-code">IfPatternMatches</a></emu-xref> of <emu-nt id="_ref_352"><a href="#prod-IfPattern">IfPattern</a></emu-nt>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPattern" collapsed="">
    <emu-nt><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="zldm3trl" id="prod-EquXXU0V"><emu-nt id="_ref_353"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="CombinedMatchPatternMatches" id="_ref_87"><a href="#sec-combined-match-pattern-matches" class="e-user-code">CombinedMatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_354"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-primitive-pattern-matches" type="sdo" aoid="PrimitivePatternMatches">
      <h1><span class="secnum">30.1.4</span> Runtime Semantics: PrimitivePatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> PrimitivePatternMatches takes argument <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_88"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns a Boolean. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="PrimitivePattern" collapsed="">
    <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kul-a19e" id="prod-mlLTmHeP"><emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="SameValueZero"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>(<var>subject</var>, !&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="PrimitivePattern" collapsed="">
    <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e_otk8es" id="prod-eFLzsKUd"><emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-xref aoid="SameValueNonNumber"><a href="https://tc39.es/ecma262/#sec-samevaluenonnumber">SameValueNonNumber</a></emu-xref>(<var>subject</var>, !&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>).</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-variable-declaration-pattern-matches" type="sdo" aoid="VariableDeclarationPatternMatches">
      <h1><span class="secnum">30.1.5</span> Runtime Semantics: VariableDeclarationPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> VariableDeclarationPatternMatches takes argument <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_89"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns a Boolean. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="VariableDeclarationPattern" collapsed="">
    <emu-nt><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="p6fje17y" id="prod-Otz3gD-Y">
        <emu-nt id="_ref_355"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>TODO: This section is not written in the spec language yet.</li><li>Let <var>name</var> be <emu-xref aoid="StringValue"><a href="https://tc39.es/ecma262/#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Initialize variable <var>name</var> with <var>subject</var> with the semantics of <code>var</code>, <code>let</code> or <code>const</code> based on <emu-nt id="_ref_356"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-member-expression-pattern-matches" type="sdo" aoid="MemberExpressionPatternMatches">
      <h1><span class="secnum">30.1.6</span> Runtime Semantics: MemberExpressionPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> MemberExpressionPatternMatches takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_90"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MemberExpressionPattern" collapsed="">
    <emu-nt><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="887ylmg0" id="prod--tiCo4Kg"><emu-nt id="_ref_357"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_358"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>If <var>ref</var> is a <emu-xref href="#sec-reference-record-specification-type"><a href="https://tc39.es/ecma262/#sec-reference-record-specification-type">Reference Record</a></emu-xref> and <emu-xref aoid="IsPropertyReference"><a href="https://tc39.es/ecma262/#sec-ispropertyreference">IsPropertyReference</a></emu-xref>(<var>ref</var>) is <emu-val>true</emu-val>, let <var>receiver</var> be <emu-xref aoid="GetThisValue"><a href="https://tc39.es/ecma262/#sec-getthisvalue">GetThisValue</a></emu-xref>(<var>ref</var>).</li><li>Else, let <var>receiver</var> be <emu-val>null</emu-val>.</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="InvokeCustomMatcher" id="_ref_91"><a href="#sec-invoke-custom-matcher" class="e-user-code">InvokeCustomMatcher</a></emu-xref>(<var>value</var>, <var>subject</var>, <var>cacheGroup</var>, <emu-const>boolean</emu-const>, <var>receiver</var>).</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> <emu-xref href="#sec-ecmascript-language-types-boolean-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-boolean-type">is a Boolean</a></emu-xref>.</li><li>Return <var>result</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MemberExpressionPattern" collapsed="">
    <emu-nt><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="df-_ftrt" id="prod-UC7vB794">
        <emu-nt id="_ref_359"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
        <emu-t>(</emu-t>
        <emu-nt optional="" id="_ref_360"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_361"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>If <var>ref</var> is a <emu-xref href="#sec-reference-record-specification-type"><a href="https://tc39.es/ecma262/#sec-reference-record-specification-type">Reference Record</a></emu-xref> and <emu-xref aoid="IsPropertyReference"><a href="https://tc39.es/ecma262/#sec-ispropertyreference">IsPropertyReference</a></emu-xref>(<var>ref</var>) is <emu-val>true</emu-val>, let <var>receiver</var> be <emu-xref aoid="GetThisValue"><a href="https://tc39.es/ecma262/#sec-getthisvalue">GetThisValue</a></emu-xref>(<var>ref</var>).</li><li>Else, let <var>receiver</var> be <emu-val>null</emu-val>.</li><li>Let <var>listMatchResult</var> be ?&nbsp;<emu-xref aoid="InvokeCustomMatcher" id="_ref_92"><a href="#sec-invoke-custom-matcher" class="e-user-code">InvokeCustomMatcher</a></emu-xref>(<var>value</var>, <var>subject</var>, <var>cacheGroup</var>, <emu-const>list</emu-const>, <var>receiver</var>).</li><li>If <var>listMatchResult</var> is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>listMatchResult</var> is an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>.</li><li>If <emu-nt id="_ref_362"><a href="#prod-MatchList">MatchList</a></emu-nt> is not present, then<ol><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_93"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>listMatchResult</var>, <var>cacheGroup</var>, 0).</li></ol></li><li>Return ?&nbsp;<emu-xref aoid="ListPatternMatches" id="_ref_94"><a href="#sec-list-pattern-matches" class="e-user-code">ListPatternMatches</a></emu-xref> of <emu-nt id="_ref_363"><a href="#prod-MatchList">MatchList</a></emu-nt> with arguments <var>listMatchResult</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-object-pattern-matches" type="sdo" aoid="ObjectPatternMatches">
      <h1><span class="secnum">30.1.7</span> Runtime Semantics: ObjectPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ObjectPatternMatches takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_95"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="ObjectPattern" collapsed="">
    <emu-nt><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-ijKqIu5y">
        <emu-t>{</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is an Object</a></emu-xref>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="ObjectPattern" collapsed="">
    <emu-nt><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="o1dsndx3" id="prod-rsN4rFAw">
        <emu-t>{</emu-t>
        <emu-nt id="_ref_364"><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_96"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_365"><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="ObjectPattern" collapsed="">
    <emu-nt><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fzjtv8n6" id="prod-t1nKdCY9">
        <emu-t>{</emu-t>
        <emu-nt id="_ref_366"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt>
        <emu-t optional="">,<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_97"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_367"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="ObjectPattern" collapsed="">
    <emu-nt><a href="#prod-ObjectPattern">ObjectPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vxmanhfb" id="prod-yj96DPDb">
        <emu-t>{</emu-t>
        <emu-nt id="_ref_368"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt id="_ref_369"><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_98"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_370"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>If <emu-nt id="_ref_371"><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt> is not present, return <emu-val>true</emu-val>.</li><li>Let <var>restMatches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_99"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_372"><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and <var>matches</var>.</li><li>If <var>restMatches</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-object-pattern-inner-matches" type="sdo" aoid="ObjectPatternInnerMatches">
      <h1><span class="secnum">30.1.8</span> Runtime Semantics: ObjectPatternInnerMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ObjectPatternInnerMatches takes arguments <var>subject</var> (an Object), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>excludedNames</var> (a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of String) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of String or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchRestProperty" collapsed="">
    <emu-nt><a href="#prod-MatchRestProperty">MatchRestProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_dw8adpi" id="prod-CVegFgkL">
        <emu-t>...</emu-t>
        <emu-nt id="_ref_373"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>restObj</var> be <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.es/ecma262/#sec-properties-of-the-object-prototype-object">%Object.prototype%</a></emu-xref>).</li><li>Perform ?&nbsp;<emu-xref aoid="CopyDataProperties"><a href="https://tc39.es/ecma262/#sec-copydataproperties" class="e-user-code">CopyDataProperties</a></emu-xref>(<var>restObj</var>, <var>subject</var>, <var>excludedNames</var>).</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_100"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_374"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>restObj</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>false</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Return «&nbsp;».</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPropertyList" collapsed="">
    <emu-nt><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="itbva-y6" id="prod-T4vISnOq"><emu-nt id="_ref_375"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_101"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_376"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and <var>excludedNames</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchPropertyList" collapsed="">
    <emu-nt><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="q97kd0i8" id="prod-qAB6O-_U">
        <emu-nt id="_ref_377"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt id="_ref_378"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_102"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_379"><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and <var>excludedNames</var>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li>Let <var>propMatches</var> be ?&nbsp;<emu-xref aoid="ObjectPatternInnerMatches" id="_ref_103"><a href="#sec-object-pattern-inner-matches" class="e-user-code">ObjectPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_380"><a href="#prod-MatchPropertyList">MatchPropertyList</a></emu-nt> with arguments <var>subject</var>, <var>cacheGroup</var> and <var>matches</var>.</li><li>If <var>propMatches</var> is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>matches</var> and <var>propMatches</var> are <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Lists</a></emu-xref> of String.</li><li>Return the <emu-xref href="#list-concatenation"><a href="https://tc39.es/ecma262/#list-concatenation">list-concatenation</a></emu-xref> of <var>matches</var> and <var>propMatches</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchProperty" collapsed="">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8fjnez1" id="prod-wn8ysC7M">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>propertyName</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>.</li><li>If ?&nbsp;<emu-xref aoid="HasPropertyCached" id="_ref_104"><a href="#sec-has-property-cached" class="e-user-code">HasPropertyCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>) is <emu-val>false</emu-val>, then<ol><li>If <code>?</code> is present, return «&nbsp;».</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Return « <var>propertyName</var>&nbsp;».</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchProperty" collapsed="">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9mxwi2yo" id="prod-K_6p11YI">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt id="_ref_381"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>propertyName</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a></emu-nt>.</li><li>If ?&nbsp;<emu-xref aoid="HasPropertyCached" id="_ref_105"><a href="#sec-has-property-cached" class="e-user-code">HasPropertyCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>) is <emu-val>false</emu-val>, then<ol><li>If <code>?</code> is present, return «&nbsp;».</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetCached" id="_ref_106"><a href="#sec-get-cached" class="e-user-code">GetCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>).</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_107"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_382"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>value</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>false</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Return « <var>propertyName</var>&nbsp;».</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchProperty" collapsed="">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gzjg2iry" id="prod-67mQe-Kl">
        <emu-nt id="_ref_383"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>TODO: This section is not written in the spec language yet.</li><li>Let <var>propertyName</var> be <emu-xref aoid="StringValue"><a href="https://tc39.es/ecma262/#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>If ?&nbsp;<emu-xref aoid="HasPropertyCached" id="_ref_108"><a href="#sec-has-property-cached" class="e-user-code">HasPropertyCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>) is <emu-val>false</emu-val>, then<ol><li>If <code>?</code> is present, return «&nbsp;».</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetCached" id="_ref_109"><a href="#sec-get-cached" class="e-user-code">GetCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>).</li><li>Initialize variable <var>propertyName</var> with <var>value</var> with the semantics of <code>var</code>, <code>let</code> or <code>const</code> based on <emu-nt id="_ref_384"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>.</li><li>Return « <var>propertyName</var>&nbsp;».</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchProperty" collapsed="">
    <emu-nt><a href="#prod-MatchProperty">MatchProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f0mgqa9f" id="prod-dFlCv79J">
        <emu-nt id="_ref_385"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt id="_ref_386"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>TODO: This section is not written in the spec language yet.</li><li>Let <var>propertyName</var> be <emu-xref aoid="StringValue"><a href="https://tc39.es/ecma262/#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>If ?&nbsp;<emu-xref aoid="HasPropertyCached" id="_ref_110"><a href="#sec-has-property-cached" class="e-user-code">HasPropertyCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>) is <emu-val>false</emu-val>, then<ol><li>If <code>?</code> is present, return «&nbsp;».</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetCached" id="_ref_111"><a href="#sec-get-cached" class="e-user-code">GetCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var>).</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_112"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_387"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>value</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>false</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Initialize variable <var>propertyName</var> with <var>value</var> with the semantics of <code>var</code>, <code>let</code> or <code>const</code> based on <emu-nt id="_ref_388"><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>.</li><li>Return « <var>propertyName</var>&nbsp;».</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-array-pattern-matches" type="sdo" aoid="ArrayPatternMatches">
      <h1><span class="secnum">30.1.9</span> Runtime Semantics: ArrayPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ArrayPatternMatches takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_113"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="ArrayPattern" collapsed="">
    <emu-nt><a href="#prod-ArrayPattern">ArrayPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="maizfmp4" id="prod-PyMOIQ3Y">
        <emu-t>[</emu-t>
        <emu-nt optional="" id="_ref_389"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.es/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(? <emu-xref aoid="GetCached" id="_ref_114"><a href="#sec-get-cached" class="e-user-code">GetCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <emu-xref href="#sec-well-known-symbols" id="_ref_115"><a href="#sec-well-known-symbols">%Symbol.iterator%</a></emu-xref>)) is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>Let <var>iteratorRecord</var> be ?&nbsp;<emu-xref aoid="GetIteratorCached" id="_ref_116"><a href="#sec-get-iterator-cached" class="e-user-code">GetIteratorCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>).</li><li>If <emu-nt id="_ref_390"><a href="#prod-MatchList">MatchList</a></emu-nt> is not present, then<ol><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_117"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, 0).</li></ol></li><li>Return ?&nbsp;<emu-xref aoid="ListPatternMatches" id="_ref_118"><a href="#sec-list-pattern-matches" class="e-user-code">ListPatternMatches</a></emu-xref> of <emu-nt id="_ref_391"><a href="#prod-MatchList">MatchList</a></emu-nt> with arguments <var>iteratorRecord</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-list-pattern-matches" type="sdo" aoid="ListPatternMatches">
      <h1><span class="secnum">30.1.10</span> Runtime Semantics: ListPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ListPatternMatches takes arguments <var>iterator</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchList" collapsed="">
    <emu-nt><a href="#prod-MatchList">MatchList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ayksfmrr" id="prod-jo48_6Fj">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt optional="" id="_ref_392"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>visitedCount</var> be 0.</li><li>If <emu-nt><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a></emu-nt> is present, then<ol><li>If ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_119"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, 0) is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>Set <var>visitedCount</var> to 1.</li></ol></li><li>If <emu-nt id="_ref_393"><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> is present, then<ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_120"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_394"><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>visitedCount</var>.</li><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_121"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>matches</var>).</li></ol></li><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_122"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>visitedCount</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchList" collapsed="">
    <emu-nt><a href="#prod-MatchList">MatchList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="pcmx0uf1" id="prod-ZH2p23SX"><emu-nt id="_ref_395"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_123"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_396"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and 0.</li><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_124"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>matches</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchList" collapsed="">
    <emu-nt><a href="#prod-MatchList">MatchList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uah6njv4" id="prod-TB4qCm-Y">
        <emu-nt id="_ref_397"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt optional="" id="_ref_398"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>visitedCount</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_125"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_399"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and 0.</li><li>If <var>visitedCount</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>visitedCount</var> is a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>.</li><li>If <emu-nt><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a></emu-nt> is present, then<ol><li>If ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_126"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>visitedCount</var>) is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>Set <var>visitedCount</var> to <var>visitedCount</var> + 1.</li></ol></li><li>If <emu-nt id="_ref_400"><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> is present, then<ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_127"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_401"><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>visitedCount</var>.</li><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_128"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>matches</var>).</li></ol></li><li>Return ?&nbsp;<emu-xref aoid="FinishListMatch" id="_ref_129"><a href="#sec-finish-list-match" class="e-user-code">FinishListMatch</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>visitedCount</var>).</li></ol></emu-alg>
      <emu-note><span class="note">Note</span><div class="note-contents">
        It is possible to use <emu-xref href="#sec-lengthofarraylike"><a href="https://tc39.es/ecma262/#sec-lengthofarraylike">array-like object</a></emu-xref> or <emu-xref aoid="IsArray"><a href="https://tc39.es/ecma262/#sec-isarray">IsArray</a></emu-xref> semantics rather than iterator protocol if there is performance issue reported from the engine.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-list-pattern-inner-matches" type="sdo" aoid="ListPatternInnerMatches">
      <h1><span class="secnum">30.1.11</span> Runtime Semantics: ListPatternInnerMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ListPatternInnerMatches takes arguments <var>iterator</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>startIndex</var> (a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>, <emu-const>unlimited</emu-const> or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchElementList" collapsed="">
    <emu-nt><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dlv9v-6j" id="prod-xREui9vq"><emu-nt id="_ref_402"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_130"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_403"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>startIndex</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElementList" collapsed="">
    <emu-nt><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="eheyxnr4" id="prod-OcHtMyto">
        <emu-nt id="_ref_404"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt id="_ref_405"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>visitedCount</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_131"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_406"><a href="#prod-MatchElementList">MatchElementList</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>startIndex</var>.</li><li>If <var>visitedCount</var> is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>visitedCount</var> is a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>.</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_132"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_407"><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>startIndex</var> + <var>visitedCount</var>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>matches</var> is a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>.</li><li>Return <var>visitedCount</var> + <var>matches</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElisionElement" collapsed="">
    <emu-nt><a href="#prod-MatchElisionElement">MatchElisionElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="c0r7zx1e" id="prod-3oXeLOQS">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt id="_ref_408"><a href="#prod-MatchElement">MatchElement</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>visitedCount</var> be 0.</li><li>If <emu-nt><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a></emu-nt> is present, then<ol><li>If ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_133"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>startIndex</var>) is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li>Set <var>visitedCount</var> to <var>visitedCount</var> + 1.</li></ol></li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="ListPatternInnerMatches" id="_ref_134"><a href="#sec-list-pattern-inner-matches" class="e-user-code">ListPatternInnerMatches</a></emu-xref> of <emu-nt id="_ref_409"><a href="#prod-MatchElement">MatchElement</a></emu-nt> with arguments <var>iterator</var>, <var>cacheGroup</var> and <var>startIndex</var> + <var>visitedCount</var>.</li><li>If <var>matches</var> is <emu-const>not-matched</emu-const>, return <emu-const>not-matched</emu-const>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>matches</var> is a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>.</li><li>Return <var>visitedCount</var> + <var>matches</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchElement" collapsed="">
    <emu-nt><a href="#prod-MatchElement">MatchElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qvuneavu" id="prod-wWtr3ozj">
        <emu-nt id="_ref_410"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_135"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>startIndex</var>).</li><li>If <var>value</var> is <emu-const>not-matched</emu-const>, then<ol><li>If <code>?</code> is present, return 1.</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_136"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_411"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>value</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>false</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Return 1.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchRestElement" collapsed="">
    <emu-nt><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uugqq7gf" id="prod-iIwhAXB2"><emu-t>...</emu-t></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return <emu-const>unlimited</emu-const>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchRestElement" collapsed="">
    <emu-nt><a href="#prod-MatchRestElement">MatchRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_dw8adpi" id="prod-QkDn-2nd">
        <emu-t>...</emu-t>
        <emu-nt id="_ref_412"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>elements</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>i</var> be <var>startIndex</var>.</li><li>Let <var>next</var> be <emu-const>unused</emu-const>.</li><li>Repeat, while <var>next</var> is not <emu-const>not-matched</emu-const>,<ol><li>Set <var>next</var> to ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_137"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>i</var>).</li><li>If <var>next</var> is not <emu-const>not-matched</emu-const>, append <var>next</var> to <var>elements</var>.</li><li>Set <var>i</var> to <var>i</var> + 1.</li></ol></li><li>Let <var>rest</var> be <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>elements</var>).</li><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_138"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_413"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>rest</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>false</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Return <emu-const>unlimited</emu-const>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-unary-algebraic-pattern-matches" type="sdo" aoid="UnaryAlgebraicPatternMatches">
      <h1><span class="secnum">30.1.12</span> Runtime Semantics: UnaryAlgebraicPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> UnaryAlgebraicPatternMatches takes argument <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_139"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="UnaryAlgebraicPattern" collapsed="">
    <emu-nt><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrpolaez" id="prod-HOehzcwY"><emu-nt id="_ref_414"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_415"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>If <emu-nt id="_ref_416"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a></emu-nt> is <code>+</code> <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt> or <code>-</code> <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt>, return <emu-xref aoid="SameValue"><a href="https://tc39.es/ecma262/#sec-samevalue">SameValue</a></emu-xref>(<var>subject</var>, <var>value</var>).</li><li>Return <emu-xref aoid="SameValueZero"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>(<var>subject</var>, <var>value</var>).</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        <p>Only literal <code>+0</code> or <code>-0</code> will be matched with <emu-xref aoid="SameValue"><a href="https://tc39.es/ecma262/#sec-samevalue">SameValue</a></emu-xref>, <code>+</code><var>x</var> and <code>-</code><var>x</var> where <var>x</var> is 0 will be matched with <emu-xref aoid="SameValueZero"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>.</p>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-relational-pattern-matches" type="sdo" aoid="RelationalPatternMatches">
      <h1><span class="secnum">30.1.13</span> Runtime Semantics: RelationalPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> RelationalPatternMatches takes argument <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_140"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cpk601fr" id="prod-HIh36vwy">
        <emu-t>&lt;</emu-t>
        <emu-nt id="_ref_417"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var><emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, a Number or a BigInt, return <emu-val>false</emu-val>.</li><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_418"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be ?&nbsp;<emu-xref aoid="IsLessThan"><a href="https://tc39.es/ecma262/#sec-islessthan" class="e-user-code">IsLessThan</a></emu-xref>(<var>subject</var>, <var>value</var>, <emu-val>true</emu-val>).</li><li>If <var>r</var> is <emu-val>undefined</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <var>r</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fizzqlnh" id="prod-7OFxsw1H">
        <emu-t>&gt;</emu-t>
        <emu-nt id="_ref_419"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var><emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, a Number or a BigInt, return <emu-val>false</emu-val>.</li><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_420"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be ?&nbsp;<emu-xref aoid="IsLessThan"><a href="https://tc39.es/ecma262/#sec-islessthan" class="e-user-code">IsLessThan</a></emu-xref>(<var>value</var>, <var>subject</var>, <emu-val>false</emu-val>).</li><li>If <var>r</var> is <emu-val>undefined</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <var>r</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="wcfltxip" id="prod-06obvqDG">
        <emu-t>&lt;=</emu-t>
        <emu-nt id="_ref_421"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var><emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, a Number or a BigInt, return <emu-val>false</emu-val>.</li><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_422"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be ?&nbsp;<emu-xref aoid="IsLessThan"><a href="https://tc39.es/ecma262/#sec-islessthan" class="e-user-code">IsLessThan</a></emu-xref>(<var>subject</var>, <var>value</var>, <emu-val>true</emu-val>).</li><li>If <var>r</var> is either <emu-val>true</emu-val> or <emu-val>undefined</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <emu-val>true</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="p9dtsxo3" id="prod-RHBOL0Pm">
        <emu-t>&gt;=</emu-t>
        <emu-nt id="_ref_423"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var><emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, a Number or a BigInt, return <emu-val>false</emu-val>.</li><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_424"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be ?&nbsp;<emu-xref aoid="IsLessThan"><a href="https://tc39.es/ecma262/#sec-islessthan" class="e-user-code">IsLessThan</a></emu-xref>(<var>value</var>, <var>subject</var>, <emu-val>false</emu-val>).</li><li>If <var>r</var> is either <emu-val>true</emu-val> or <emu-val>undefined</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <emu-val>true</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ofwypd4t" id="prod-yy5yPHTl">
        <emu-t>instanceof</emu-t>
        <emu-nt id="_ref_425"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_426"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Return ?&nbsp;<emu-xref aoid="InstanceofOperator"><a href="https://tc39.es/ecma262/#sec-instanceofoperator" class="e-user-code">InstanceofOperator</a></emu-xref>(<var>subject</var>, <var>value</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="co-9ob3a" id="prod-4m0pop5D">
        <emu-t>in</emu-t>
        <emu-nt id="_ref_427"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>If <var>subject</var> is not a <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">property key</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_428"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>If <var>value</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, return <emu-val>false</emu-val>.</li><li>Return ?&nbsp;<emu-xref aoid="HasProperty"><a href="https://tc39.es/ecma262/#sec-hasproperty" class="e-user-code">HasProperty</a></emu-xref>(<var>value</var>, <var>subject</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qryc-uca" id="prod--dRddGUV">
        <emu-t>==</emu-t>
        <emu-nt id="_ref_429"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_430"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Return ?&nbsp;<emu-xref aoid="IsLooselyEqual"><a href="https://tc39.es/ecma262/#sec-islooselyequal" class="e-user-code">IsLooselyEqual</a></emu-xref>(<var>subject</var>, <var>value</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="igncusy5" id="prod-w4_WjGgR">
        <emu-t>!=</emu-t>
        <emu-nt id="_ref_431"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_432"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be ?&nbsp;<emu-xref aoid="IsLooselyEqual"><a href="https://tc39.es/ecma262/#sec-islooselyequal" class="e-user-code">IsLooselyEqual</a></emu-xref>(<var>subject</var>, <var>value</var>).</li><li>If <var>r</var> is <emu-val>true</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <emu-val>true</emu-val>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ozo8rdvg" id="prod-7Ze364jc">
        <emu-t>===</emu-t>
        <emu-nt id="_ref_433"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_434"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Return <emu-xref aoid="IsStrictlyEqual"><a href="https://tc39.es/ecma262/#sec-isstrictlyequal">IsStrictlyEqual</a></emu-xref>(<var>subject</var>, <var>value</var>).</li></ol></emu-alg>
      <emu-grammar><emu-production name="RelationalPattern" collapsed="">
    <emu-nt><a href="#prod-RelationalPattern">RelationalPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g2pgwtyq" id="prod-jvHPj17C">
        <emu-t>!==</emu-t>
        <emu-nt id="_ref_435"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>expr</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_436"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a></emu-nt>.</li><li>Let <var>ref</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>expr</var>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>ref</var>).</li><li>Let <var>r</var> be <emu-xref aoid="IsStrictlyEqual"><a href="https://tc39.es/ecma262/#sec-isstrictlyequal">IsStrictlyEqual</a></emu-xref>(<var>subject</var>, <var>value</var>).</li><li>If <var>r</var> is <emu-val>true</emu-val>, return <emu-val>false</emu-val>. Otherwise, return <emu-val>true</emu-val>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-if-pattern-matches" type="sdo" aoid="IfPatternMatches">
      <h1><span class="secnum">30.1.14</span> Runtime Semantics: IfPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IfPatternMatches takes no arguments and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="IfPattern" collapsed="">
    <emu-nt><a href="#prod-IfPattern">IfPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="5soi6w1x" id="prod-OcKu_40M">
        <emu-t>if</emu-t>
        <emu-t>(</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li><li>Return <emu-xref aoid="ToBoolean"><a href="https://tc39.es/ecma262/#sec-toboolean">ToBoolean</a></emu-xref>(<var>result</var>).</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-combined-match-pattern-matches" type="sdo" aoid="CombinedMatchPatternMatches">
      <h1><span class="secnum">30.1.15</span> Runtime Semantics: CombinedMatchPatternMatches</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> CombinedMatchPatternMatches takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_141"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="CombinedMatchPattern" collapsed="">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4lmqei0y" id="prod-TGrK8XcZ">
        <emu-nt id="_ref_437"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>and</emu-t>
        <emu-nt id="_ref_438"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>leftMatches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_142"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of the first <emu-nt id="_ref_439"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>leftMatches</var> is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>Return ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_143"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of the second <emu-nt id="_ref_440"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="CombinedMatchPattern" collapsed="">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9wuvrand" id="prod-hYdo8hkU">
        <emu-nt id="_ref_441"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>or</emu-t>
        <emu-nt id="_ref_442"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>leftMatches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_144"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of the first <emu-nt id="_ref_443"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>leftMatches</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_145"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of the second <emu-nt id="_ref_444"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="CombinedMatchPattern" collapsed="">
    <emu-nt><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_ieabtbd" id="prod-_QtiVeJ1">
        <emu-t>not</emu-t>
        <emu-nt id="_ref_445"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_146"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_446"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>true</emu-val>, return <emu-val>false</emu-val>.</li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-match-expression">
    <h1><span class="secnum">30.2</span> The <code>match</code> Expression</h1>
    <h2>Syntax</h2>
    <emu-grammar type="definition"><emu-production name="MatchExpression" params="Yield, Await" id="prod-MatchExpression">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpression">MatchExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mvw1s1gm" id="prod-jdvmig2z">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_447"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
<emu-production name="MatchExpressionClauses" params="Yield, Await" id="prod-MatchExpressionClauses">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="m1oof3mn" id="prod-zNwY0NcB">
        <emu-nt params="?Yield, ?Await" id="_ref_448"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="t_ii54i_" id="prod-ZOtaLsb5">
        <emu-nt params="?Yield, ?Await" id="_ref_449"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-nt params="?Yield, ?Await" id="_ref_450"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="fbzye5as" id="prod-inqwxZRh">
        <emu-nt params="?Yield, ?Await" id="_ref_451"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vewutigw" id="prod-iGULIx-t">
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
<emu-production name="MatchExpressionClause" params="Yield, Await" id="prod-MatchExpressionClause">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ll2690mf" id="prod-POLnbn8y">
        <emu-nt params="?Yield, ?Await" id="_ref_452"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <h2>Supplemental Syntax</h2>
    <p>
      When processing an instance of the production<br>
      <emu-grammar><emu-production name="MatchExpression" collapsed="" class=" inline">
    <emu-nt><a href="#prod-MatchExpression">MatchExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="y2kk1jwh">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
        <emu-t>{</emu-t>
        <emu-nt id="_ref_453"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar><br>
      the interpretation of <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> is refined using the following grammar:
    </p>
    <emu-grammar type="definition"><emu-production name="MatchHead" id="prod-MatchHead">
    <emu-nt><a href="#prod-MatchHead">MatchHead</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qvsbvt69">
        <emu-t>match</emu-t>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>(</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
    <emu-note code=""><span class="note">Note</span><div class="note-contents">
      <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> result = match (value) {
  { <span class="hljs-attr">op</span>: <span class="hljs-string">"add"</span>, <span class="hljs-keyword">let</span> lhs, <span class="hljs-keyword">let</span> rhs }: lhs + rhs,
  { <span class="hljs-attr">op</span>: <span class="hljs-string">"sub"</span>, <span class="hljs-keyword">let</span> lhs, <span class="hljs-keyword">let</span> rhs }: lhs - rhs,
  { <span class="hljs-attr">op</span>: <span class="hljs-string">"mul"</span>, <span class="hljs-keyword">let</span> lhs, <span class="hljs-keyword">let</span> rhs }: lhs * rhs,
  { <span class="hljs-attr">op</span>: <span class="hljs-string">"div"</span>, <span class="hljs-keyword">let</span> lhs, <span class="hljs-keyword">let</span> rhs }: lhs / rhs,
}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      <p>
        If <a href="https://github.com/tc39/proposal-do-expressions" target="_blank" data-print-href="">the <code>do</code> expression proposal</a> will never happen,
        we will need to add a statement version of <emu-nt id="_ref_454"><a href="#prod-MatchExpression">MatchExpression</a></emu-nt>.
      </p>
      <pre><code class="javascript hljs">match (value) {
  { <span class="hljs-keyword">let</span> x, <span class="hljs-keyword">let</span> y, <span class="hljs-keyword">let</span> z }: <span class="hljs-keyword">do</span> {
    <span class="hljs-keyword">const</span> w = <span class="hljs-title function_">average</span>(x, y, z);
    <span class="hljs-keyword">return</span> w * w;
  },
  <span class="hljs-comment">// ...</span>
}</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      This feature can be replaced by the <emu-xref href="#sec-relational-operators" id="_ref_17"><a href="#sec-relational-operators"><code>is</code> expression</a></emu-xref>.
      The code example above can be written as:
      <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> result =
  value is { <span class="hljs-attr">op</span>: <span class="hljs-string">"add"</span>, <span class="hljs-keyword">var</span> lhs, <span class="hljs-keyword">var</span> rhs } ? lhs + rhs :
  value is { <span class="hljs-attr">op</span>: <span class="hljs-string">"sub"</span>, <span class="hljs-keyword">var</span> lhs, <span class="hljs-keyword">var</span> rhs } ? lhs - rhs :
  value is { <span class="hljs-attr">op</span>: <span class="hljs-string">"mul"</span>, <span class="hljs-keyword">var</span> lhs, <span class="hljs-keyword">var</span> rhs } ? lhs * rhs :
  value is { <span class="hljs-attr">op</span>: <span class="hljs-string">"div"</span>, <span class="hljs-keyword">var</span> lhs, <span class="hljs-keyword">var</span> rhs } ? lhs / rhs :
  (<span class="hljs-function">() =&gt;</span> { <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">TypeError</span>() })</code></pre>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      It is syntactically impossible to have a match expression that
      <ul>
        <li>has no clause.</li>
        <li>has multiple <code>default</code> clauses.</li>
        <li>the <code>default</code> clause is not the final clause.</li>
      </ul>
    </div></emu-note>
    <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
      Rename <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> to CoverCallExpressionAndAsyncArrowHeadAndMatchHead.
    </div></emu-note>

    <emu-clause id="sec-match-expression-static-semantics-early-errors">
        <h1><span class="secnum">30.2.1</span> Static Semantics: Early Errors</h1>
        <emu-grammar><emu-production name="MatchExpression" collapsed="">
    <emu-nt><a href="#prod-MatchExpression">MatchExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="y2kk1jwh">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
        <emu-t>{</emu-t>
        <emu-nt id="_ref_455"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
        <ul>
            <li><emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> <emu-xref href="#must-cover"><a href="https://tc39.es/ecma262/#must-cover">must cover</a></emu-xref> an <emu-nt id="_ref_456"><a href="#prod-MatchHead">MatchHead</a></emu-nt>.</li>
        </ul>
    </emu-clause>

    <emu-clause id="sec-match-expression-runtime-semantics-evaluation">
      <h1><span class="secnum">30.2.2</span> Runtime Semantics: Evaluation</h1>
      <emu-grammar><emu-production name="MatchExpression" collapsed="">
    <emu-nt><a href="#prod-MatchExpression">MatchExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="y2kk1jwh">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
        <emu-t>{</emu-t>
        <emu-nt id="_ref_457"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>head</var> be the <emu-nt id="_ref_458"><a href="#prod-MatchHead">MatchHead</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar"><a href="https://tc39.es/ecma262/#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>.</li><li>Let <var>subjectParseNode</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> of <var>head</var>.</li><li>Let <var>subjectRef</var> be the ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <var>subjectParseNode</var>.</li><li>Let <var>subject</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>subjectRef</var>).</li><li>Let <var>cacheGroup</var> be <emu-xref aoid="CreateMatchCache" id="_ref_147"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref>().</li><li>Let <var>matchCompletion</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_148"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_459"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>).</li><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="FinishMatch" id="_ref_149"><a href="#sec-finish-match" class="e-user-code">FinishMatch</a></emu-xref>(<var>matchCompletion</var>, <var>cacheGroup</var>)).</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</li><li>Return <var>result</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-match-expression-clauses-runtime-semantics-evaluation" type="sdo" aoid="MatchExpressionClausesEvaluation">
      <h1><span class="secnum">30.2.3</span> Runtime Semantics: MatchExpressionClausesEvaluation</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> MatchExpressionClausesEvaluation takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_150"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either an <emu-xref href="#sec-ecmascript-language-types" id="_ref_151"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref> or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uzg4qni-" id="prod-Rom5m7Ja"><emu-nt id="_ref_460"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="MatchExpressionClauseEvaluation" id="_ref_152"><a href="#sec-match-expression-clause-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClauseEvaluation</a></emu-xref> of <emu-nt id="_ref_461"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mxhusj8b" id="prod-ndBX1W1V">
        <emu-nt id="_ref_462"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-nt id="_ref_463"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_153"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_464"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_154"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is <emu-const>not-matched</emu-const>.</li><li>Return ?&nbsp;<emu-xref aoid="MatchExpressionClauseEvaluation" id="_ref_155"><a href="#sec-match-expression-clause-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClauseEvaluation</a></emu-xref> of <emu-nt id="_ref_465"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g1pmaudo" id="prod--Nw1hDs1">
        <emu-nt id="_ref_466"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_156"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_467"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_157"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is <emu-const>not-matched</emu-const>.</li><li>Return ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li></ol></emu-alg>
      <emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xhzralk2" id="prod-QDysejGw">
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-match-expression-clause-runtime-semantics-evaluation" type="sdo" aoid="MatchExpressionClauseEvaluation">
      <h1><span class="secnum">30.2.4</span> Runtime Semantics: MatchExpressionClauseEvaluation</h1>
      <p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations"><a href="https://tc39.es/ecma262/#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> MatchExpressionClauseEvaluation takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_158"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either an <emu-xref href="#sec-ecmascript-language-types" id="_ref_159"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref> or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
      <emu-grammar><emu-production name="MatchExpressionClause" collapsed="">
    <emu-nt><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="pjnnj8-j" id="prod-dgN-SNm3">
        <emu-nt id="_ref_468"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt>
        <emu-t>:</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>
    </emu-rhs>
</emu-production>
</emu-grammar>
      <emu-alg><ol><li>Let <var>matches</var> be ?&nbsp;<emu-xref aoid="MatchPatternMatches" id="_ref_160"><a href="#sec-match-pattern-matches" class="e-user-code">MatchPatternMatches</a></emu-xref> of <emu-nt id="_ref_469"><a href="#prod-MatchPattern">MatchPattern</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>matches</var> is <emu-val>true</emu-val>, return ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-abstract-operations-for-pattern-matching">
    <h1><span class="secnum">30.3</span> Abstract Operations for Pattern Matching</h1>

    <emu-clause id="sec-invoke-custom-matcher" type="abstract operation" aoid="InvokeCustomMatcher">
      <h1><span class="secnum">30.3.1</span> InvokeCustomMatcher ( <var>matcher</var>, <var>subject</var>, <var>cacheGroup</var>, <var>kind</var>, <var>receiver</var> )</h1>
      <p>The abstract operation InvokeCustomMatcher takes arguments <var>matcher</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_161"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>), <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_162"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), <var>kind</var> (<emu-const>boolean</emu-const> or <emu-const>list</emu-const>), and <var>receiver</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_163"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a Boolean or an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li>If <var>matcher</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, then<ol><li>If <var>kind</var> is <emu-const>boolean</emu-const>, return <emu-xref aoid="SameValueZero"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>(<var>matcher</var>, <var>subject</var>).</li><li>Throw a <emu-val>TypeError</emu-val> exception.</li></ol></li><li>Let <var>f</var> be ?&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>matcher</var>, <emu-xref href="#sec-well-known-symbols" id="_ref_164"><a href="#sec-well-known-symbols">%Symbol.customMatcher%</a></emu-xref>).</li><li>If <var>f</var> is <emu-val>undefined</emu-val>, then<ol><li>If <var>kind</var> is <emu-const>boolean</emu-const>, return <emu-xref aoid="SameValueNonNumber"><a href="https://tc39.es/ecma262/#sec-samevaluenonnumber">SameValueNonNumber</a></emu-xref>(<var>matcher</var>, <var>subject</var>).</li><li>Throw a <emu-val>TypeError</emu-val> exception.</li></ol></li><li>If <var>kind</var> is <emu-const>boolean</emu-const>, let <var>hint</var> be <emu-val>"boolean"</emu-val>.</li><li>Else, let <var>hint</var> be <emu-val>"list"</emu-val>.</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call" class="e-user-code">Call</a></emu-xref>(<var>f</var>, <var>matcher</var>, « <var>subject</var>, <var>hint</var>, <var>receiver</var>&nbsp;»).</li><li>If <var>result</var> is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li id="step-invoke-custom-matcher">If <var>kind</var> is <emu-const>boolean</emu-const>, return <emu-xref aoid="ToBoolean"><a href="https://tc39.es/ecma262/#sec-toboolean">ToBoolean</a></emu-xref>(<var>result</var>).</li><li>If <var>result</var> <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">is not an Object</a></emu-xref>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Perform ?&nbsp;<emu-xref aoid="GetIteratorCached" id="_ref_165"><a href="#sec-get-iterator-cached" class="e-user-code">GetIteratorCached</a></emu-xref>(<var>result</var>, <var>cacheGroup</var>).</li><li>Return <var>result</var>.</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        The <var>hint</var> parameter is not a consensus in the champion group yet. This design is to solve <a href="https://github.com/tc39/proposal-pattern-matching/issues/253" target="_blank" data-print-href="">runtime performance concerns about custom matchers</a>.
      </div></emu-note>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        The <var>receiver</var> parameter is not a consensus in the champion group yet. This design is to keep the <code>this</code> value when calling the custom matchers. Not everyone in the champion group agrees we need to keep the <code>this</code> value.
        <pre><code class="javascript hljs"><span class="hljs-keyword">const</span> zero = <span class="hljs-keyword">new</span> <span class="hljs-title class_">BigNumber</span>(<span class="hljs-number">0</span>);
match (expr) {
  zero.<span class="hljs-property">equal</span>: <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'zero point matched.'</span>);
  <span class="hljs-title class_">BigNumber</span>: <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(expr.<span class="hljs-title function_">toString</span>() + <span class="hljs-string">' left.'</span>);
}</code></pre>
      </div></emu-note>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        The <emu-xref aoid="ToBoolean"><a href="https://tc39.es/ecma262/#sec-toboolean">ToBoolean</a></emu-xref> in step <emu-xref href="#step-invoke-custom-matcher" id="_ref_18"><a href="#step-invoke-custom-matcher">8</a></emu-xref> cause a strange behaviour around <a href="#sec-IsHTMLDDA-internal-slot-to-boolean" target="_blank"><var class="field">[[IsHTMLDDA]]</var></a>.
        <pre><code class="javascript hljs"><span class="hljs-keyword">function</span> <span class="hljs-title function_">f</span>(<span class="hljs-params"></span>) { <span class="hljs-keyword">return</span> <span class="hljs-variable language_">document</span>.<span class="hljs-property">all</span>; }
<span class="hljs-keyword">if</span> (<span class="hljs-literal">null</span> is f) {}
<span class="hljs-comment">// not match, by ToBoolean</span>
<span class="hljs-keyword">if</span> (<span class="hljs-literal">null</span> is <span class="hljs-title function_">f</span>(<span class="hljs-keyword">let</span> html, ...)) {}
<span class="hljs-comment">// match, because document.all is an object and has [Symbol.iterator].</span></code></pre>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-validatecustommatcherhint" type="abstract operation" aoid="ValidateCustomMatcherHint">
        <h1><span class="secnum">30.3.2</span> ValidateCustomMatcherHint ( <var>hint</var> [ , <var>kind</var> ] )</h1>
        <p>The abstract operation ValidateCustomMatcherHint takes argument <var>hint</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_166"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and optional argument <var>kind</var> (<emu-const>boolean</emu-const> or <emu-const>list</emu-const>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> <emu-const>unused</emu-const> or a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>. It performs the following steps when called:</p>
        <emu-alg><ol><li>If <var>hint</var> is not <emu-val>"boolean"</emu-val> or <emu-val>"list"</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>kind</var> is not present, return <emu-const>unused</emu-const>.</li><li>If <var>hint</var> is <emu-val>"boolean"</emu-val> and <var>kind</var> is <emu-const>list</emu-const>, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>hint</var> is <emu-val>"list"</emu-val> and <var>kind</var> is <emu-const>boolean</emu-const>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
    </emu-clause>
    <emu-note type="editor" id="sec-pattern-match-cache-note"><span class="note"><a href="#sec-pattern-match-cache-note">Editor's Note</a></span><div class="note-contents">
      The following sections describe how pattern matching matches the <var>subject</var> with a cache. Those sections use <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>, <emu-xref href="#sec-set-constructor"><a href="https://tc39.es/ecma262/#sec-set-constructor">%Set%</a></emu-xref> and <emu-xref href="#sec-array-constructor"><a href="https://tc39.es/ecma262/#sec-array-constructor">%Array%</a></emu-xref> internally. This is for the convenience. Implementations don't have to actually create those data structures behind the scenes.
      It is a spec bug if operations on cache objects trigger any user code.
    </div></emu-note>

    <emu-clause id="sec-creatematchcache" type="abstract operation" aoid="CreateMatchCache">
        <h1><span class="secnum">30.3.3</span> CreateMatchCache ( )</h1>
        <p>The abstract operation CreateMatchCache takes no arguments and returns a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>. It performs the following steps when called:</p>
        <emu-alg><ol><li>Let <var>map</var> be !&nbsp;<emu-xref aoid="Construct"><a href="https://tc39.es/ecma262/#sec-construct">Construct</a></emu-xref>(<emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>).</li><li>Let <var>iteratorsToClose</var> be !&nbsp;<emu-xref aoid="Construct"><a href="https://tc39.es/ecma262/#sec-construct">Construct</a></emu-xref>(<emu-xref href="#sec-set-constructor"><a href="https://tc39.es/ecma262/#sec-set-constructor">%Set%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>map</var>, <emu-val>"IteratorsToClose"</emu-val>, <var>iteratorsToClose</var>).</li><li>Return <var>map</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-match-cache" type="abstract operation" aoid="GetMatchCache">
      <h1><span class="secnum">30.3.4</span> GetMatchCache ( <var>subject</var>, <var>cacheGroup</var> )</h1>
      <p>The abstract operation GetMatchCache takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_167"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns an <emu-xref href="#sec-ecmascript-language-types" id="_ref_168"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_169"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>If !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.has%</a></emu-xref>, <var>cacheGroup</var>, « <var>subject</var>&nbsp;») is <emu-val>true</emu-val>, then<ol><li>Return !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.get%</a></emu-xref>, <var>cacheGroup</var>, « <var>subject</var>&nbsp;»).</li></ol></li><li>Let <var>cache</var> be <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-val>null</emu-val>).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>cache</var>, <emu-val>"Has"</emu-val>, !&nbsp;<emu-xref aoid="Construct"><a href="https://tc39.es/ecma262/#sec-construct">Construct</a></emu-xref>(<emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>)).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>cache</var>, <emu-val>"Get"</emu-val>, !&nbsp;<emu-xref aoid="Construct"><a href="https://tc39.es/ecma262/#sec-construct">Construct</a></emu-xref>(<emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>)).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>cache</var>, <emu-val>"Iterator"</emu-val>, <emu-val>undefined</emu-val>).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>cache</var>, <emu-val>"IteratedValues"</emu-val>, !&nbsp;<emu-xref aoid="ArrayCreate"><a href="https://tc39.es/ecma262/#sec-arraycreate">ArrayCreate</a></emu-xref>(0, <emu-val>null</emu-val>)).</li><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.set%</a></emu-xref>, <var>cacheGroup</var>, « <var>subject</var>, <var>cache</var>&nbsp;»).</li><li>Return <var>cache</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-has-property-cached" type="abstract operation" aoid="HasPropertyCached">
      <h1><span class="secnum">30.3.5</span> HasPropertyCached ( <var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var> )</h1>
      <p>The abstract operation HasPropertyCached takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_170"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>propertyName</var> (a <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">property key</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_171"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>Let <var>cache</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<emu-xref aoid="GetMatchCache" id="_ref_172"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>), <emu-val>"Has"</emu-val>).</li><li>Let <var>hasCache</var> be !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.has%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>&nbsp;»).</li><li>If <var>hasCache</var> is <emu-val>true</emu-val>, return !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.get%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>&nbsp;»).</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="HasProperty"><a href="https://tc39.es/ecma262/#sec-hasproperty" class="e-user-code">HasProperty</a></emu-xref>(<var>subject</var>, <var>propertyName</var>).</li><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.set%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>, <var>result</var>&nbsp;»).</li><li>Return <var>result</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-cached" type="abstract operation" aoid="GetCached">
      <h1><span class="secnum">30.3.6</span> GetCached ( <var>subject</var>, <var>cacheGroup</var>, <var>propertyName</var> )</h1>
      <p>The abstract operation GetCached takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_173"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>propertyName</var> (a <emu-xref href="#sec-object-type"><a href="https://tc39.es/ecma262/#sec-object-type">property key</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> an <emu-xref href="#sec-ecmascript-language-types" id="_ref_174"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_175"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>Let <var>cache</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<emu-xref aoid="GetMatchCache" id="_ref_176"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>), <emu-val>"Get"</emu-val>).</li><li>Let <var>hasCache</var> be !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.has%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>&nbsp;»).</li><li>If <var>hasCache</var> is <emu-val>true</emu-val>, return !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.get%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>&nbsp;»).</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>subject</var>, <var>propertyName</var>).</li><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-map.prototype.has"><a href="https://tc39.es/ecma262/#sec-map.prototype.has">%Map.prototype.set%</a></emu-xref>, <var>cache</var>, « <var>propertyName</var>, <var>result</var>&nbsp;»).</li><li>Return <var>result</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-iterator-cached" type="abstract operation" aoid="GetIteratorCached">
      <h1><span class="secnum">30.3.7</span> GetIteratorCached ( <var>subject</var>, <var>cacheGroup</var> )</h1>
      <p>The abstract operation GetIteratorCached takes arguments <var>subject</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_177"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_178"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>Let <var>cache</var> be <emu-xref aoid="GetMatchCache" id="_ref_179"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>).</li><li>Let <var>iteratorRecordObject</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>cache</var>, <emu-val>"Iterator"</emu-val>).</li><li>If <var>iteratorRecordObject</var> is not <emu-val>undefined</emu-val>, return <var>iteratorRecordObject</var>.<var class="field">[[CachedIterator]]</var>.</li><li>Let <var>f</var> be ?&nbsp;<emu-xref aoid="GetCached" id="_ref_180"><a href="#sec-get-cached" class="e-user-code">GetCached</a></emu-xref>(<var>subject</var>, <var>cacheGroup</var>, <emu-xref href="#sec-well-known-symbols" id="_ref_181"><a href="#sec-well-known-symbols">%Symbol.iterator%</a></emu-xref>).</li><li>Let <var>iteratorRecord</var> be ?&nbsp;<emu-xref aoid="GetIteratorFromMethod"><a href="https://tc39.es/ecma262/#sec-getiteratorfrommethod" class="e-user-code">GetIteratorFromMethod</a></emu-xref>(<var>subject</var>, <var>f</var>).</li><li>Set <var>iteratorRecordObject</var> to <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-val>null</emu-val>, « <var class="field">[[CachedIterator]]</var>&nbsp;»).</li><li>Set <var>iteratorRecordObject</var>.<var class="field">[[CachedIterator]]</var> to <var>iteratorRecord</var>.</li><li>Perform !&nbsp;<emu-xref aoid="Set"><a href="https://tc39.es/ecma262/#sec-set-o-p-v-throw">Set</a></emu-xref>(<var>cache</var>, <emu-val>"Iterator"</emu-val>, <var>iteratorRecordObject</var>, <emu-val>true</emu-val>).</li><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-set.prototype.add"><a href="https://tc39.es/ecma262/#sec-set.prototype.add">%Set.prototype.add%</a></emu-xref>, !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>cacheGroup</var>, <emu-val>"IteratorsToClose"</emu-val>), « <var>iteratorRecordObject</var>&nbsp;»).</li><li>Return <var>iteratorRecordObject</var>.<var class="field">[[CachedIterator]]</var>.</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        The <var class="field">[[CachedIterator]]</var> field is only used in GetIteratorCached and CloseCachedIterators. <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Records</a></emu-xref> are not <emu-xref href="#sec-ecmascript-language-types" id="_ref_182"><a href="#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref> and cannot be Set on an object, therefore an object is created to wrap the <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>.
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-iterator-step-cached" type="abstract operation" aoid="IteratorStepCached">
      <h1><span class="secnum">30.3.8</span> IteratorStepCached ( <var>iterator</var>, <var>cacheGroup</var> )</h1>
      <p>The abstract operation IteratorStepCached takes arguments <var>iterator</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either an <emu-xref href="#sec-ecmascript-language-types" id="_ref_183"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref> or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_184"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>If <var>iterator</var>.<var class="field">[[Done]]</var> is <emu-val>true</emu-val>, return <emu-const>not-matched</emu-const>.</li><li>Let <var>cache</var> be <emu-xref aoid="GetMatchCache" id="_ref_185"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>).</li><li>Let <var>iteratedValues</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>cache</var>, <emu-val>"IteratedValues"</emu-val>).</li><li>Let <var>iteratorResult</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="IteratorStep"><a href="https://tc39.es/ecma262/#sec-iteratorstep" class="e-user-code">IteratorStep</a></emu-xref>(<var>iterator</var>)).</li><li>If <var>iteratorResult</var> is an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, set <var>iterator</var>.<var class="field">[[Done]]</var> to <emu-val>true</emu-val>.</li><li><emu-xref aoid="ReturnIfAbrupt"><a href="https://tc39.es/ecma262/#sec-returnifabrupt">ReturnIfAbrupt</a></emu-xref>(<var>iteratorResult</var>).</li><li>If <var>iteratorResult</var> is <emu-val>false</emu-val>, then<ol><li>Set <var>iterator</var>.<var class="field">[[Done]]</var> to <emu-val>true</emu-val>.</li><li>Return <emu-const>not-matched</emu-const>.</li></ol></li><li>Let <var>value</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="IteratorValue"><a href="https://tc39.es/ecma262/#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>iteratorResult</var>)).</li><li>If <var>value</var> is an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, set <var>iterator</var>.<var class="field">[[Done]]</var> to <emu-val>true</emu-val>.</li><li><emu-xref aoid="ReturnIfAbrupt"><a href="https://tc39.es/ecma262/#sec-returnifabrupt">ReturnIfAbrupt</a></emu-xref>(<var>value</var>).</li><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<emu-xref href="#sec-array.prototype.push"><a href="https://tc39.es/ecma262/#sec-array.prototype.push">%Array.prototype.push%</a></emu-xref>, <var>iteratedValues</var>, « <var>value</var>&nbsp;»).</li><li>Return <var>value</var>.</li></ol></emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-iterator-nth-value-cached" type="abstract operation" aoid="GetIteratorNthValueCached">
      <h1><span class="secnum">30.3.9</span> GetIteratorNthValueCached ( <var>iterator</var>, <var>cacheGroup</var>, <var>n</var> )</h1>
      <p>The abstract operation GetIteratorNthValueCached takes arguments <var>iterator</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>n</var> (a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either an <emu-xref href="#sec-ecmascript-language-types" id="_ref_186"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref> or <emu-const>not-matched</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li>NOTE: 0<sup>th</sup> is the first value.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_187"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>Let <var>iteratedValues</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<emu-xref aoid="GetMatchCache" id="_ref_188"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>), <emu-val>"IteratedValues"</emu-val>).</li><li>Let <var>nthItem</var> be !&nbsp;<var>iteratedValues</var>.<var class="field">[[GetOwnProperty]]</var>(<var>n</var>).</li><li>If <var>nthItem</var> is not <emu-val>undefined</emu-val>, return <var>nthItem</var>.<var class="field">[[Value]]</var>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: !&nbsp;<emu-xref aoid="LengthOfArrayLike"><a href="https://tc39.es/ecma262/#sec-lengthofarraylike">LengthOfArrayLike</a></emu-xref>(<var>iteratedValues</var>) is <var>n</var>. For example, <var>iteratedValues</var> has 0 values, <var>n</var> should be 0 to get the first value from the iterator.</li><li>Return ?&nbsp;<emu-xref aoid="IteratorStepCached" id="_ref_189"><a href="#sec-iterator-step-cached" class="e-user-code">IteratorStepCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>).</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        This abstract operation gets the n<sup>th</sup> (start from 0) value of the <var>iterator</var>, and runs <emu-xref aoid="IteratorStepCached" id="_ref_190"><a href="#sec-iterator-step-cached">IteratorStepCached</a></emu-xref> if it is not cached in the <var>cacheGroup</var>.
        For all <var>n</var> &gt; 1, this abstract operation expects these invariants:
        <ul>
          <li>The evaluation of <emu-nt id="_ref_470"><a href="#prod-MatchList">MatchList</a></emu-nt> always evaluates the <var>n</var>-1<sup>th</sup> value before evaluating the <var>n</var><sup>th</sup>.</li>
          <li>If the <var>n</var><sup>th</sup> value is exists (<var class="field">[[GetOwnProperty]]</var>(<var>n</var>) returns a <emu-xref href="#sec-property-descriptor-specification-type"><a href="https://tc39.es/ecma262/#sec-property-descriptor-specification-type">Property Descriptor</a></emu-xref>), the <var>n</var>-1<sup>th</sup> value also exists.</li>
          <li>If the <var>n</var><sup>th</sup> value does not exist and the <var>iterator</var>.<var class="field">[[Done]]</var> is <emu-val>true</emu-val>, there is no further call with a bigger <var>n</var> parameter with the same <var>cacheGroup</var> and <var>iterator</var>.</li>
        </ul>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-finish-list-match" type="abstract operation" aoid="FinishListMatch">
      <h1><span class="secnum">30.3.10</span> FinishListMatch ( <var>iterator</var>, <var>cacheGroup</var>, <var>expectedLength</var> )</h1>
      <p>The abstract operation FinishListMatch takes arguments <var>iterator</var> (an <emu-xref href="#sec-iterator-records"><a href="https://tc39.es/ecma262/#sec-iterator-records">Iterator Record</a></emu-xref>), <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>), and <var>expectedLength</var> (either a non-negative <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>, <emu-const>not-matched</emu-const> or <emu-const>unlimited</emu-const>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a Boolean or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li>If <var>expectedLength</var> is <emu-const>not-matched</emu-const>, return <emu-val>false</emu-val>.</li><li>If <var>expectedLength</var> is <emu-const>unlimited</emu-const>, return <emu-val>true</emu-val>.</li><li>Let <var>cache</var> be <emu-xref aoid="GetMatchCache" id="_ref_191"><a href="#sec-get-match-cache">GetMatchCache</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>).</li><li>Let <var>cachedLength</var> be !&nbsp;<emu-xref aoid="LengthOfArrayLike"><a href="https://tc39.es/ecma262/#sec-lengthofarraylike">LengthOfArrayLike</a></emu-xref>(! <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>cache</var>, <emu-val>"IteratedValues"</emu-val>)).</li><li>If <var>cachedLength</var> &gt; <var>expectedLength</var>, return <emu-val>false</emu-val>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cachedLength</var> is <var>expectedLength</var>.</li><li>If <var>iterator</var>.<var class="field">[[Done]]</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Let <var>iteratorResult</var> be ?&nbsp;<emu-xref aoid="GetIteratorNthValueCached" id="_ref_192"><a href="#sec-get-iterator-nth-value-cached" class="e-user-code">GetIteratorNthValueCached</a></emu-xref>(<var>iterator</var>, <var>cacheGroup</var>, <var>expectedLength</var>).</li><li>If <var>iteratorResult</var> is <emu-const>not-matched</emu-const>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        <p>This abstract operation is called the final step of the evaluation of <emu-nt id="_ref_471"><a href="#prod-MatchList">MatchList</a></emu-nt>.</p>
        <p>
          For example, when matching with <code>[]</code>, the <var>expectedLength</var> is 0.
          This abstract operation checks if <var>cachedLength</var> is 0.
          If the <var>iterator</var> is done, the match succeeds.
          If the <var>iterator</var> is not done, it will try to get the 0<sup>th</sup> value from the iterator.
          If there is a 0<sup>th</sup> value, the match fails.
        </p>
        <p>
          Another example is when matching with <code>[1, 2, 3]</code>, the <var>expectedLength</var> is 3.
          This abstract operation checks if <var>cachedLength</var> is 3.
          If the <var>iterator</var> is done, the match succeeds.
          If the <var>iterator</var> is not done, it will try to get the 3<sup>th</sup> (remember we start from the 0<sup>th</sup>) value from the iterator.
          If there is a 3<sup>rd</sup> (which means the <var>cachedLength</var> is now 4) value, the match fails.
        </p>
      </div></emu-note>
    </emu-clause>

    <emu-clause id="sec-finish-match" type="abstract operation" aoid="FinishMatch">
      <h1><span class="secnum">30.3.11</span> FinishMatch ( <var>matchCompletion</var>, <var>cacheGroup</var> )</h1>
      <p>The abstract operation FinishMatch takes arguments <var>matchCompletion</var> (a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">Completion Record</a></emu-xref>) and <var>cacheGroup</var> (a <emu-xref href="#sec-map-constructor"><a href="https://tc39.es/ecma262/#sec-map-constructor">%Map%</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">Completion Record</a></emu-xref>. It performs the following steps when called:</p>
      <emu-alg><ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>cacheGroup</var> is created by <emu-xref aoid="CreateMatchCache" id="_ref_193"><a href="#sec-creatematchcache">CreateMatchCache</a></emu-xref> and used internally for pattern-matching.</li><li>If <var>matchCompletion</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> and <var>matchCompletion</var>.<var class="field">[[Value]]</var> is <emu-const>not-matched</emu-const>, then<ol><li>Set <var>matchCompletion</var> to <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(a newly created <emu-val>TypeError</emu-val>).</li></ol></li><li>Let <var>iterators</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>For each element <var>value</var> of !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>cacheGroup</var>, <emu-val>"IteratorsToClose"</emu-val>).<var class="field">[[SetData]]</var>, do<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>value</var>.<var class="field">[[Value]]</var> is not <emu-const>empty</emu-const>.</li><li>Let <var>iteratorRecordObject</var> be !&nbsp;<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>value</var>.<var class="field">[[Value]]</var>, <emu-val>"IteratorsToClose"</emu-val>).</li><li>Append <var>iteratorRecordObject</var>.<var class="field">[[CachedIterator]]</var> to <var>iterators</var>.</li></ol></li><li>Let <var>errors</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>matchCompletion</var> is an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, append <var>matchCompletion</var>.<var class="field">[[Value]]</var> to <var>errors</var>.</li><li>For each element <var>iterator</var> of <var>iterators</var>, do<ol><li>If <var>iterator</var>.<var class="field">[[Done]]</var> is <emu-val>false</emu-val>, then<ol><li>Let <var>closeResult</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="IteratorClose"><a href="https://tc39.es/ecma262/#sec-iteratorclose" class="e-user-code">IteratorClose</a></emu-xref>(<var>iterator</var>, <emu-xref aoid="NormalCompletion"><a href="https://tc39.es/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>undefined</emu-val>))).</li><li>If <var>closeResult</var> is an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, append <var>closeResult</var>.<var class="field">[[Value]]</var> to <var>errors</var>.</li></ol></li></ol></li><li>If <var>errors</var> is not empty, then<ol><li>If length of <var>errors</var> is 1, return <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>errors</var>[0]).</li><li>Let <var>error</var> be a newly created <emu-val>AggregateError</emu-val> object.</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>error</var>, "errors", PropertyDescriptor { <var class="field">[[Configurable]]</var>: true, <var class="field">[[Enumerable]]</var>: false, <var class="field">[[Writable]]</var>: true, <var class="field">[[Value]]</var>: <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(errors)&nbsp;}).</li><li>Return <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>error</var>).</li></ol></li><li>Return <var>matchCompletion</var>.</li></ol></emu-alg>
      <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
        <p>If any error occurs when closing iterators, this abstract operation ignores the <var>matchCompletion</var> and returns an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. This might be problematic when the <var>matchCompletion</var> is a Return <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>, Continue <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>, or a Break <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>.</p>
        <pre><code class="javascript hljs"><span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> iterator <span class="hljs-keyword">of</span> iterators) {
  <span class="hljs-keyword">try</span> {
    <span class="hljs-title function_">match</span>(<span class="hljs-params">iterator</span>) {
      [<span class="hljs-title class_">String</span>, ...] and [...<span class="hljs-keyword">let</span> list]: <span class="hljs-title function_">callback</span>(list);
      [...]: <span class="hljs-keyword">continue</span>;
    }
  } <span class="hljs-keyword">catch</span> {
  }
}</code></pre>
        <p>
          In the code example above,
          if the second branch matches (and returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">continue completion</a></emu-xref>),
          but the iterator throws an error when closing,
          the <code>continue</code> will be ignored,
          and the <code>catch</code> block will be evaluated.
        </p>
      </div></emu-note>
    </emu-clause>
  </emu-clause>
</emu-clause>

<emu-annex id="sec-grammar-summary">
  <h1><span class="secnum">A</span> Grammar Summary</h1>

  <emu-annex id="sec-expressions" number="1">
    <h1><span class="secnum">A.1</span> Expressions</h1>
    <emu-production name="PrimaryExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-PrimaryExpression">PrimaryExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mbzy6lvr">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
    </emu-rhs>
    <ins><emu-rhs a="xhniddxr" id="prod-XSmG8KFu">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpression">MatchExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs></ins>
</emu-production>
    <emu-production name="RelationalExpression" params="In, Yield, Await">
    <emu-nt params="In, Yield, Await"><a href="#prod-RelationalExpression">RelationalExpression</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <ins><emu-rhs a="7pwutwad" id="prod-EdmoEhta">
        <emu-nt params="?In, ?Yield, ?Await"><a href="#prod-RelationalExpression">RelationalExpression</a><emu-mods><emu-params>[?In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>is</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs></ins>
</emu-production>
    <emu-production name="MatchExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpression">MatchExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mvw1s1gm" id="prod-jdvmig2z">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-gann>[no <emu-nt><a href="https://tc39.es/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchExpressionClauses" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="m1oof3mn" id="prod-zNwY0NcB">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="t_ii54i_" id="prod-ZOtaLsb5">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="fbzye5as" id="prod-inqwxZRh">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>;</emu-t>
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vewutigw" id="prod-iGULIx-t">
        <emu-t>default</emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchExpressionClause" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ll2690mf" id="prod-POLnbn8y">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>:</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
  </emu-annex>

  <emu-annex id="sec-annex-match-patterns" number="9">
    <h1><span class="secnum">A.9</span> Patterns</h1>
    <emu-production name="MatchPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iwqh9pom" id="prod-KUcUUgsn">
        <emu-t>(</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
    <emu-rhs a="sgh9k7d8" id="prod-NnfvhTBM">
        <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="vrxdrcn-" id="prod--5M7srSm">
        <emu-nt params="?Yield, ?Await"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="y46cfqhm" id="prod-dtu4srcz">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="hgfidvsy" id="prod-ZdrTiyJE">
        <emu-nt params="?Yield, ?Await"><a href="#prod-ObjectPattern">ObjectPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="x-p6r7m6" id="prod-l2SLZUMT">
        <emu-nt params="?Yield, ?Await"><a href="#prod-ArrayPattern">ArrayPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="6m-vwede" id="prod-en0pW04U">
        <emu-nt params="?Yield, ?Await"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="od8b4me6" id="prod-LetWbF4Q">
        <emu-nt params="?Yield, ?Await"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="4brcj28h" id="prod-GC1hibKU">
        <emu-nt params="?Yield, ?Await"><a href="#prod-IfPattern">IfPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="_7vcs4wd" id="prod-LAj8DpMp">
        <emu-nt params="?Yield, ?Await"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="PrimitivePattern">
    <emu-nt><a href="#prod-PrimitivePattern">PrimitivePattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kul-a19e" id="prod-lZG2aTTb">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="e_otk8es" id="prod-rqU7_eLx">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="VariableDeclarationPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-VariableDeclarationPattern">VariableDeclarationPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="97sngitm" id="prod-u_-PVDpb">
        <emu-nt><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="VarOrLetOrConst">
    <emu-nt><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="5hawgwsl">
        <emu-t>var</emu-t>
    </emu-rhs>
    <emu-rhs a="0oi0tt1n">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-LetOrConst">LetOrConst</a></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MemberExpressionPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MemberExpressionPattern">MemberExpressionPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uxdrsrnt" id="prod-G4gXeSPg">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="k5qxkpt8" id="prod-QmuUz1ZR">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>(</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="ObjectPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-ObjectPattern">ObjectPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-nriCsL_r">
        <emu-t>{</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="rqbh5emu" id="prod-EWVgVnxN">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="criubbam" id="prod-UnQjidH-">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">,<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="9huzo627" id="prod-xpU3Tqeh">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="ArrayPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-ArrayPattern">ArrayPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hiem5cht" id="prod-mfwF-eVh">
        <emu-t>[</emu-t>
        <emu-nt params="?Yield, ?Await" optional=""><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="UnaryAlgebraicPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-UnaryAlgebraicPattern">UnaryAlgebraicPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tmtbe2kk" id="prod-blOttJBG">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="RelationalPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-RelationalPattern">RelationalPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ueb64z-p" id="prod-Ee4jkDah">
        <emu-t>&lt;</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="_g7ioekk" id="prod-Lt1ufiOJ">
        <emu-t>&gt;</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="rl3zkfvt" id="prod-MbwVHJm5">
        <emu-t>&lt;=</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="h7t5jy7j" id="prod-LIsJEGG_">
        <emu-t>&gt;=</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="2x6y5fx8" id="prod-sQz7HIlw">
        <emu-t>instanceof</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="seylmk0k" id="prod-wD-UQ48A">
        <emu-t>in</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="gquawcje" id="prod-LdC39dQb">
        <emu-t>==</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="blybrpqt" id="prod-WzM35PsW">
        <emu-t>!=</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="ui_gas75" id="prod-ofL39yLB">
        <emu-t>===</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vehxltqc" id="prod-atFGrhH0">
        <emu-t>!==</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="IfPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-IfPattern">IfPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sgbsfmyz" id="prod-F0nSIfMB">
        <emu-t>if</emu-t>
        <emu-t>(</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>)</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="CombinedMatchPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-CombinedMatchPattern">CombinedMatchPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ao53rdyl" id="prod-a_2cW9fV">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>and</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="nhqoi23u" id="prod-BMX8uZDG">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>or</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="qryeevni" id="prod-4IhLPseH">
        <emu-t>not</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <p>
      Object in pattern-matching:
    </p>
    <emu-production name="ObjectPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-ObjectPattern">ObjectPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-nriCsL_r">
        <emu-t>{</emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="rqbh5emu" id="prod-EWVgVnxN">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="criubbam" id="prod-UnQjidH-">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">,<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>}</emu-t>
    </emu-rhs>
    <emu-rhs a="9huzo627" id="prod-xpU3Tqeh">
        <emu-t>{</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>}</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchRestProperty" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchRestProperty">MatchRestProperty</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rfqjkmvm" id="prod-NpqrpNeK">
        <emu-t>...</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchPropertyList" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3j9bvwgo" id="prod-kRoJE3bP">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="jbgwhfq0" id="prod-_cQam8pS">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPropertyList">MatchPropertyList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchProperty" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchProperty">MatchProperty</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4z7kdpah" id="prod-VxHnNNub">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="jy5wa0t2" id="prod-GMqEmzsz">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="17gzu0ni" id="prod-GO0bgB3_">
        <emu-nt><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
    <emu-rhs a="w_78smtm" id="prod-xrsY-24G">
        <emu-nt><a href="#prod-VarOrLetOrConst">VarOrLetOrConst</a></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
        <emu-t>:</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <p>
      Array in pattern-matching:
    </p>
    <emu-production name="ArrayPattern" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-ArrayPattern">ArrayPattern</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hiem5cht" id="prod-mfwF-eVh">
        <emu-t>[</emu-t>
        <emu-nt params="?Yield, ?Await" optional=""><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchList" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchList">MatchList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ctjw6vnw" id="prod-xnwBdNr0">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await" optional=""><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="q59bwnvc" id="prod-5aJhmP6v">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="f1xo1a3j" id="prod-Qinb_JH_">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await" optional=""><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchRestElement" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchRestElement">MatchRestElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uugqq7gf" id="prod-fOlW2Nsd">
        <emu-t>...</emu-t>
    </emu-rhs>
    <emu-rhs a="rfqjkmvm" id="prod-w_IWHbxt">
        <emu-t>...</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchElementList" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mftbrreq" id="prod-gb-onOzg">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="ubrozurn" id="prod--q9atpfX">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElementList">MatchElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>,</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchElisionElement" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElisionElement">MatchElisionElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vcapw5oy" id="prod-SwXPxa2u">
        <emu-nt optional=""><a href="https://tc39.es/ecma262/#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchElement">MatchElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="MatchElement" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-MatchElement">MatchElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="umiqybes" id="prod-lKjcdi_o">
        <emu-nt params="?Yield, ?Await"><a href="#prod-MatchPattern">MatchPattern</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t optional="">?<emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-t>
    </emu-rhs>
</emu-production>
    <p>
      Limited <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>s which is evaluated as an <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt> in pattern-matching:
    </p>
    <emu-production name="PatternMatchingMemberExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jo4mwtvh">
        <emu-t>this</emu-t>
    </emu-rhs>
    <emu-rhs a="yb7id2be">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-MetaProperty">MetaProperty</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="dlsgch-w">
        <emu-nt params="?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-IdentifierReference">IdentifierReference</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="9pdsslwb">
        <emu-t>super</emu-t>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="kupcnmlh">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="ks20qjkp">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>.</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="qvqrwddh">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>[</emu-t>
        <emu-nt params="+In, ?Yield, ?Await"><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
        <emu-t>]</emu-t>
    </emu-rhs>
</emu-production>
    <emu-production name="PatternMatchingUnaryAlgebraicExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qi2orlde">
        <emu-t>+</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="vdzozs8g">
        <emu-t>-</emu-t>
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="1epwai_f">
        <emu-t>+</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="u8w2p_fz">
        <emu-t>-</emu-t>
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NumericLiteral">NumericLiteral</a></emu-nt>
    </emu-rhs>
</emu-production>
    <emu-production name="PatternMatchingRelationalExpression" params="Yield, Await">
    <emu-nt params="Yield, Await"><a href="#prod-PatternMatchingRelationalExpression">PatternMatchingRelationalExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kul-a19e">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-Literal">Literal</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="e_otk8es">
        <emu-nt><a href="https://tc39.es/ecma262/#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
    </emu-rhs>
    <emu-rhs a="uxdrsrnt">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingMemberExpression">PatternMatchingMemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
    <emu-rhs a="tmtbe2kk">
        <emu-nt params="?Yield, ?Await"><a href="#prod-PatternMatchingUnaryAlgebraicExpression">PatternMatchingUnaryAlgebraicExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
    </emu-rhs>
</emu-production>
  </emu-annex>
</emu-annex><emu-annex id="sec-copyright-and-software-license">
      <h1><span class="secnum">B</span> Copyright &amp; Software License</h1>
      
      <h2>Copyright Notice</h2>
      <p>© 2024 Daniel Rosenwasser,Jack Works,Jordan Harband,Mark Cohen,Ross Kirsling,Tab Atkins</p>

      <h2>Software License</h2>
      <p>All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT <a href="https://ecma-international.org/memento/codeofconduct.htm">https://ecma-international.org/memento/codeofconduct.htm</a> FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.</p>

<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>

<ol>
  <li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
  <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
  <li>Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>

<p>THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>

    </emu-annex>
</div></body>